To check two input words / strings are same or different
word1 = input("Enter the first word: ")
word2 = input("Enter the second word: ") if word1 == word2: print("The words are the same.") else: print("The words are different.") Here, the program prompts the user to enter two words (`word1` and `word2`) as inputs. It then compares the two words using the `==` operator. If the two words are the same, it prints "The words are the same." Otherwise, it prints "The words are different."
Comments
Post a Comment