it looks like the python "inoperator looks for the element in the dictionary keys string comparison the following are the ways to compare two string in python by using =(equal tooperator by using !(not equal tooperator by using sorted(method by using is operator by using comparison operators comparing two strings using =(equal tooperator str input("enter the first string"str input("enter the second string"if str =str print ("first and second strings are equal and same"elseprint ("first and second strings are not same"outputenter the first stringaa enter the second stringaa first and second strings are equal and same comparing two strings using !(not equal tooperator str input("enter the first string"str input("enter the second string"if str !str print ("first and second strings are not equal "elseprint ("first and second strings are the same "outputenter the first stringab enter the second stringba first and second strings are not equal