def insenStringCompare(s1, s2):""" Method that takes two strings and returns True or False, based on if they are equal, regardless of case.""" try: return s1.lower() == s2.lower() except AttributeError: print "Please only pass strings into this method." print "You passed a %s and %s" % (s1.__class__, s2.__class__)
↧
Answer by Patrick Harrington for How do I do a case-insensitive string comparison?
↧