added new python programs with solutions for the ideas listed on the wordplay page
[wordplay-cdsw-solutions] / idea_5.py
diff --git a/idea_5.py b/idea_5.py
new file mode 100644 (file)
index 0000000..e4fee38
--- /dev/null
+++ b/idea_5.py
@@ -0,0 +1,16 @@
+# 5. Find and print the words that have all 5 vowels in alphabetical order.
+
+import scrabble
+
+vowels = ["a", "e", "i", "o", "u"]
+
+for word in scrabble.wordlist:
+    found_vowels = []
+
+    for letter in word:
+        if letter in vowels:
+            found_vowels.append(letter)
+
+    if found_vowels == vowels:
+        print(word)
+

Benjamin Mako Hill || Want to submit a patch?