Question: Implement a function anagrams() that computes anagrams of a given word. An anagram of word A is word B that can be formed by rearranging
Implement a function anagrams() that computes anagrams of a given word. An anagram of word A is word B that can be formed by rearranging the letters of A. For example, the word top is an anagram of the word pot. Your function will take as input the name of a file of words and as well as a word, and print all the words in the file that are anagrams of the input word. Use the given file words.txt as your file of words. Example output: >>> anagrams('words.txt', 'trace') crate cater react
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
