Skip to content

Conversation

@choirene
Copy link

No description provided.

letter_list = []
hand = []

for letter in LETTER_POOL.keys():
Copy link

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):
Copy link

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:
Copy link

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:
Copy link

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:
Copy link

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):
Copy link

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!

@marciaga
Copy link

marciaga commented Oct 4, 2022

Nice job!

All your tests are passing and your code is laid out well overall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants