-
Notifications
You must be signed in to change notification settings - Fork 89
Snow Leopards - Irene Cho #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| letter_list = [] | ||
| hand = [] | ||
|
|
||
| for letter in LETTER_POOL.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job with this function!
| for letter in formatted_word: | ||
| score += SCORE_CHART[letter] | ||
|
|
||
| if len(word) >= 7: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job handling the tie cases!
|
Nice job! All your tests are passing and your code is laid out well overall. |
No description provided.