Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
About
People
Publications
Teaching
Resources
Research Blog
Wiki Functions
Recent changes
Help
Licensing
Page
Discussion
Edit
View history
Editing
DS4UX (Spring 2016)/Wordplay
From CommunityData
Jump to:
navigation
,
search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[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'? What are the most possible points you can score with an English word in Scrabble? Use Python to answer questions like this instantly while practicing manipulating data from a file and regular expressions. ==Setup== Download the file following file: http://mako.cc/teaching/2015/community_data_science/wordplay.zip Once you have downloaded the file, extract the contents of the file into a folder on your desktop. To start, open a command prompt and navigate to the folder you created for wordplay; there should be several files there, one named <code>scrabble.py</code>. To test that your setup is correct, you can launch a Python instance in this folder, and run the following: import scrabble scrabble.wordlist This should display a very long list of words. ==Resources== * [[Wordplay handout]]: Project goals and cheat sheet. * [[DS4UX_(Spring_2016)/Working_within_loops|Working within loops]]: review how to apply the coding concepts we've learned so far to the Wordplay project. ==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 pages like this quiz asking to find [http://www.sporcle.com/games/imabanana/uncommonwords English words with unusual properties]. How many can you solve with Python? [[Category:DS4UX (Spring 2016)]]
Summary:
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see
CommunityData:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Tools
What links here
Related changes
Special pages
Page information