projects
/
wordplay-cdsw-solutions
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added new python programs with solutions for the ideas listed on the wordplay page
[wordplay-cdsw-solutions]
/
idea_4.py
diff --git a/idea_4.py
b/idea_4.py
new file mode 100644
(file)
index 0000000..
352b66c
--- /dev/null
+++ b/
idea_4.py
@@ -0,0
+1,13
@@
+# 4. Find an print the words that contain 4 or more 'l's.
+
+import scrabble
+
+for word in scrabble.wordlist:
+ number_of_ls = 0
+ for letter in word:
+ if letter == "l":
+ number_of_ls = number_of_ls + 1
+
+ if number_of_ls >= 4:
+ print(word)
+
Benjamin Mako Hill
||
Want to submit a patch?