Problem scenario
You want a program to test if two words are anagramous with each other. You want the test to be case insensitive. How do you write a program that will interactively prompt the user for two different words and test if they are anagrams?
Solution
Use this Python 3 program (and it will interactively prompt you to enter two words):
word1 = input("Enter one word: ").lower()
word2 = input("Enter a second word: ").lower()
wL1 = list(word1)
wL2 = list(word2)
wL1.sort()
wL2.sort()
if (wL1 == wL2):
print("The two programs are anagrams!")
else:
print("The two words are NOT anagrams!")
It will not work with Python 2.