Conversation
| letter_list = [] | ||
| hand = [] | ||
|
|
||
| for letter in LETTER_POOL.keys(): |
There was a problem hiding this comment.
In Python, looping over a dictionary this way uses its keys by default, so no need to call .keys(), you can just write
for letter in LETTER_POOL:| for num in range(LETTER_POOL[letter]): | ||
| letter_list.append(letter) | ||
|
|
||
| for draw in range(10): |
There was a problem hiding this comment.
Good job with this one! Since draw isn't being used, consider a while loop with a condition that looks at len(letter_list)
| pass | ||
| try: | ||
| formatted_word = word.upper() | ||
| except AttributeError: |
There was a problem hiding this comment.
Good job handling a case where, I believe, the parameter word isn't a string! A guard clause would be my suggestion to validate that word is a string, rather than catching the exception
| for letter in formatted_word: | ||
| score += SCORE_CHART[letter] | ||
|
|
||
| if len(word) >= 7: |
| for letter in formatted_word: | ||
| score += SCORE_CHART[letter] | ||
|
|
||
| if len(word) >= 7: |
There was a problem hiding this comment.
Per the README, the 8 bonus points should be awarded when a word is 7, 8, 9, or 10 letters long so we'll also want to have a check that the length of the word is < 11.
| for word in [first, second]: | ||
| if len(word) == 10: | ||
| return word | ||
| if len(first) < len(second): |
|
Nice job! All your tests are passing and your code is laid out well overall. |
No description provided.