how to write anagram program in python