Scrabble challenge: Difference between revisions
Content added Content deleted
imported>Jesstess |
imported>Jesstess |
||
Line 65: | Line 65: | ||
</li> |
</li> |
||
</ul> |
</ul> |
||
====Step 2: get the rack==== |
====Step 2: get the rack==== |
||
Write the code to get the Scrabble 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 `python scrabble_cheater.py RSTLNEI`, `RSTLNEI` would be the rack. |
||
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. 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 78: | Line 81: | ||
Getting and checking the number of command line arguments: http://docs.python.org/library/sys.html. |
Getting and checking the number of command line arguments: http://docs.python.org/library/sys.html. |
||
</li> |
</li> |
||
<li>Converting letters to lower case: http://docs.python.org/library/stdtypes.html#str.lower</li> |
|||
</ul> |
</ul> |
||