reworked these examples a bit based on feedback in class
[wordplay-cdsw-solutions] / idea_4.py
1 # 4. Find an print the words that contain 4 or more 'l's.
2
3 import scrabble 
4
5 for word in scrabble.wordlist:
6     number_of_ls = 0
7     for letter in word:
8         if letter == "l":
9             number_of_ls = number_of_ls + 1
10
11     if number_of_ls >= 4:
12         print(word)
13

Benjamin Mako Hill || Want to submit a patch?