If you are new to Python - a great first language - everything can be downloaded from here
Attached is the actual word lists in a .txt file. There are 113,808 individual words, each on their own line.
When you run the program the script and word list need to be in the same folder, otherwise you will get an error to the effect of "no such file exists"
Step 1: Helpful Code Sections
fin = open('words.txt') - This line opens up the file (it can be any file)
for line in fin: - This line goes through the file one line at a time up until the 113,809th line
word = line.strip() - This line removes all the white space and formatting so that only the characters in the specific line are stored in a string with variable name word.
Step 2: Words With "E"
This program runs through the word list line by line and tests to see whether "e" is in the word. If it is it keeps checking through the word to see if there are anymore "e". The total number of "e" are stored in a temporary variable. At the end of the word if that temporary variable is greater or equal to 1 does it then add 1 to the total number of words with "e", thus avoiding duplicates.
Step 3: Palindrome
If it is a palindrome it returns True otherwise it returns False
This program only checks for individual words. For an extra challenge try modify it so that it goes through the entire word list and finds all the words with palindromes.
Step 4: Use Only Some/All of Provided Letters
The words could use one, some, or all of the supplied letters. You can put in different combinations of letters to see what gives you the most or the least.
For a second program that was similar we had to modify it so that it would only print words that contained each and every word provided. However, if there were two letter "a" then the other word had to have 2 letter "a" not one and another letter of something else.
Step 5: Exclusion
What combination of words do you think excludes the fewest words?
Step 6: Alphabetical Order
The way this program works is to look at each word and go through it character by character comparing each character to the last character stored in a temporary variable. If it is in alphabetical order then it adds 1 to the total amount list.
You can actually compare characters in python for example is a < b ? Or you can convert it to a number ord[a] = 97 ord[b] = 98 and so on.
Step 7: Rotate
Since we talked about how to convert a character to number in this program it seems only fit to convert number to characters. Use the chr(x) function ex. chr(97) = "a".
This program works by converting each character in a string to a string to a number, adding the defined amount and then converting it back into a character.
Step 8: The Ultimate Project - Anagrams / Bingo Solver
Part 2 of this is to see which 8 character set forms the most anagrams in order to see what is the maximum possible number of Bingos that can be formed. It turns out there are 7 possible words that can be formed with the solution.
The most possible anagrams of a character set is 11.