Scrabble challenge: Difference between revisions

imported>Jesstess
imported>Jesstess
Line 65:
</li>
</ul>
 
 
====Step 2: get the rack====
 
Write the code to get the Scrabble rack from(the aletters commandavailable lineto argument.make Handlewords) from the casecommand whereline a userargument forgetspassed to supplyyour a rackscript. MakeFor sure you are consistent about capitalization:example if your scoresscript dictionarywere iscalled lowercase`scrabble_cheater.py`, theif lettersyou suppliedran by`python thescrabble_cheater.py userRSTLNEI`, need`RSTLNEI` towould be convertedthe to lowercase at some point before you compare themrack.
 
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>:
Line 78 ⟶ 81:
Getting and checking the number of command line arguments: http://docs.python.org/library/sys.html.
</li>
<li>Converting letters to lower case: http://docs.python.org/library/stdtypes.html#str.lower</li>
</ul>
 
Anonymous user