Check if two strings are same ignoring their cases | Function to compare two strings ignoring their cases ; Convert to uppercase ; if strings are equal , return true otherwise false ; Function to print the same or not same if strings are equal or not equal ; Driver Code
def equalIgnoreCase ( str1 , str2 ) : NEW_LINE INDENT str1 = str1 . upper ( ) ; NEW_LINE str2 = str2 . upper ( ) ; NEW_LINE x = str1 == str2 ; NEW_LINE return x ; NEW_LINE DEDENT def equalIgnoreCaseUtil ( str1 , str2 ) : NEW_LINE INDENT res = equalIgnoreCase ( str1 , str2 ) ; NEW_LINE if ( res == True ) : NEW_LINE INDENT print ( " Same " ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Not ▁ Same " ) ; NEW_LINE DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT str1 = " Geeks " ; NEW_LINE str2 = " geeks " ; NEW_LINE equalIgnoreCaseUtil ( str1 , str2 ) ; NEW_LINE str1 = " Geek " ; NEW_LINE str2 = " geeksforgeeks " ; NEW_LINE equalIgnoreCaseUtil ( str1 , str2 ) ; NEW_LINE DEDENT