python check string case insensitive

31

if firstStr.lower() == secStr.lower():
    print('Both Strings are same')
else:
    print('Strings are not same')
string1 = 'Hello'
string2 = 'hello'

if string1.lower() == string2.lower():
    print("The strings are the same (case insensitive)")
else:
    print("The strings are NOT the same (case insensitive)")

Comments

Submit
0 Comments