Python

One-Hand Word

12 points

At a recent workshop, the presenter stated that he had thought about the longest word that you could type using just one hand. For a word to qualify, you'd have to be able to type it entirely with either your left or right hand on a standard keyboard. The "left" letters are "qwertasdfgzxcv" and the "right" letters are "yuiophjklbnm." The presenter said the longest one-hand word he'd found was "average." One of the people attending the workshop commented that "averages" is longer. "Averaged" is also an 8-letter one-hand word.

In this program, you explore this topic and find out whether there are one-hand words longer than 8 letters. You read in a file with a large number of English words and go through those words to find the longest one-hand word.

 

Extra Credit (2 points)

In the program you've written, you've found the length of the longest one-hand word in the input file. There are actually 2 one-hand words with that maximum length. Find them both. You could use a Python list to store the 2 words. To add a word to a list, you can use this syntax: 'list.append(newWord)'.

 

Starting Point

Download OneHandWord.py as a starting point for the project. The file guides you towards completing the program. You can also download wordlist.txt, which has 58,112 words.