if we wish to compare two strings and check for their equality even if the order of characters/words is differentthen we first need to use sorted(method and then compare two strings str input("enter the first string"str input("enter the second string"if sorted(str =sorted(str )print ("first and second strings are equal "elseprint ("first and second strings are not the same "outputenter the first stringengineering discipline enter the second stringdiscipline engineering first and second strings are equal comparing two strings using 'isoperator python is operator returns true if two variables refer to the same object instance str "deedstr "deedstr 'join([' '' '' '' ']print(str is str print("comparision result "str is str outputtrue comparision result false in the above examplestr is str returns false because object str was created differently comparing two strings using comparison operators input 'engineeringprint(input 'engineering'print(input 'engineering'print(input <'engineering'print(input >'engineering'outputfalse