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
  • 131,796
  • 23
  • 122
  • 195
ragardner
  • 1,664
  • 3
  • 20
  • 43

0 Answers0