Question: Write a Python program called anagramsets.py that asks the user to enter a word length and a filename. The program will search the EnglishWords.txt file
Write a Python program called anagramsets.py that asks the user to enter a word length and a filename. The program will search the EnglishWords.txt file (presented at the end of the question) for sets of words that are that length and are anagrams of each other, and will write the results to a file with the given filename.
Sample User Input/Output:
***** Anagram Set Search *****
Enter word length:
12
Searching...
Enter file name:
twelve.txt
Writing results...
Expected output to twelve.txt:
['abolitionism', 'mobilisation']
['accouterment', 'accoutrement']
['alterability', 'bilaterality']
['amphitheater', 'amphitheatre']
['behaviourism', 'misbehaviour']
['commissioned', 'decommission']
['conservation', 'conversation']
['discreetness', 'discreteness']
['impressively', 'permissively']
['inactivation', 'vaticination']
['microcephaly', 'pyrochemical']
['paradisaical', 'paradisiacal']
['restrengthen', 'strengthener']
['unimpressive', 'unpermissive']
NOTE: Results are presented in alphabetical order.
-----------------------------------------------------------------------------
EnglishWords.txt
This word list is derived from the Princeton WordNet. Please refer to the copyright notice and statements. 00-database-url http://www.cogsci.princeton.edu/~wn/ 00-database-short WordNet (r) 1.7 00-database-long WordNet (r): A Lexical Database for English from the Cognitive Science Laboratory at Princeton University 00-database-info This file was converted from the original database on: Sat Jun 23 14:21:23 2001
The original data is available from: http://www.cogsci.princeton.edu/~wn/
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
