Scrabble challenge: Difference between revisions

Content added Content deleted
Line 73: Line 73:
Write the code to get the Scrabble rack (the letters available to make words) from the command line argument passed to your script. For example if your script were called `scrabble_cheater.py`, if you ran <tt>python scrabble_cheater.py RSTLNEI</tt>, <tt>RSTLNEI</tt> would be the rack.
Write the code to get the Scrabble rack (the letters available to make words) from the command line argument passed to your script. For example if your script were called `scrabble_cheater.py`, if you ran <tt>python scrabble_cheater.py RSTLNEI</tt>, <tt>RSTLNEI</tt> would be the rack.


Handle the case where a
Handle the case where a user forgets to supply a rack; in this case, print an error message saying they need to supply some letters, and then exit the program using the <code>exit()</code> function. Make sure you are consistent about capitalization: if your scores dictionary is lowercase, the letters supplied by the user need to be converted to lowercase at some point before you compare them.
a user forgets to supply a rack; in this case, print an error message saying they need to supply some letters, and then exit the program using the <code>exit()</code> function. Make sure you are consistent about capitalization: if your scores dictionary is lowercase, the letters supplied by the user need to be converted to lowercase at some point before you compare them.


<b>Step 2 resources</b>:
<b>Step 2 resources</b>:
Line 85: Line 86:
<li>Converting letters to lower case: http://docs.python.org/library/stdtypes.html#str.lower</li>
<li>Converting letters to lower case: http://docs.python.org/library/stdtypes.html#str.lower</li>
</ul>
</ul>



====Step 3: find valid words====
====Step 3: find valid words====