Wordplay: Difference between revisions
Content added Content deleted
imported>Lizdenys (→Setup) |
imported>Mako (→Goals) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[File:Crossword.png|200px]] |
|||
You are filling out a crossword and need a word that fits the pattern E*G****R. What are your options? How many words have all 5 vowels in order? What's the only common English word that ends in 'mt'? Use Python to answer questions like this instantly while practicing manipulating data from a file and regular expressions. |
You are filling out a crossword and need a word that fits the pattern E*G****R. What are your options? How many words have all 5 vowels in order? What's the only common English word that ends in 'mt'? Use Python to answer questions like this instantly while practicing manipulating data from a file and regular expressions. |
||
==Setup== |
==Setup== |
||
See the Friday setup page and the section on installing dependencies for information on getting setup. |
|||
See the [http://openhatch.org/wiki/Boston_Python_Workshop_3/Friday Friday setup instructions]. |
|||
==Handout== |
|||
[[Wordplay handout]]: goals and cheat sheet. |
|||
==Goals== |
==Goals== |
||
Line 9: | Line 15: | ||
* Have fun using Python to cheat at Scrabble and crosswords. |
* Have fun using Python to cheat at Scrabble and crosswords. |
||
* Practice using lists and manipulating strings. |
* Practice using lists and manipulating strings. |
||
* Get experience with regular expressions. |
|||
== |
==Ideas for exercises== |
||
* Find and print the words that start with "ee". |
* Find and print the words that start with "ee". |
||
Line 19: | Line 24: | ||
* Find and print the words that have all 5 vowels in alphabetical order. |
* Find and print the words that have all 5 vowels in alphabetical order. |
||
* Look for other interesting properties of English words in http://en.wikipedia.org/wiki/English_words_with_uncommon_properties and write code to find the words that have these properties. |
* Look for other interesting properties of English words in http://en.wikipedia.org/wiki/English_words_with_uncommon_properties and write code to find the words that have these properties. |
||
[[Boston Python workshop 2/Saturday projects|« Back to the Saturday project page]] |
Latest revision as of 08:11, 6 November 2014
You are filling out a crossword and need a word that fits the pattern E*G****R. What are your options? How many words have all 5 vowels in order? What's the only common English word that ends in 'mt'? Use Python to answer questions like this instantly while practicing manipulating data from a file and regular expressions.
Setup
See the Friday setup page and the section on installing dependencies for information on getting setup.
Handout
Wordplay handout: goals and cheat sheet.
Goals
- Have fun using Python to cheat at Scrabble and crosswords.
- Practice using lists and manipulating strings.
Ideas for exercises
- Find and print the words that start with "ee".
- Find and print the words that end in "mt". How about "gry"?
- Find and print the longest word that has no vowels.
- Find an print the words that contain 4 or more 'l's.
- Find and print the words that have all 5 vowels in alphabetical order.
- Look for other interesting properties of English words in http://en.wikipedia.org/wiki/English_words_with_uncommon_properties and write code to find the words that have these properties.