1

Is there some module out there that has fast case insensitive string comparisons for Python 3.x or is this the fastest way to compare A LOT of strings?

def compare(s1,s2):
    if s1.upper() == s2.upper():
        return True
    return False

print (compare("59gndif_^ngJJDS","59gndif_^ngJJDS"))
print (compare("59gndifngJJDS","insdffn"))

True
False
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
ragardner
  • 1,836
  • 5
  • 22
  • 45

0 Answers0