-
Notifications
You must be signed in to change notification settings - Fork 69
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
Whales C17- Nishat Salsabil and Julie Warren Adagrams #43
base: master
Are you sure you want to change the base?
Conversation
…e_02 tests; wave_02 complete
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.
Great work on this project, Nish and Julie! The code you wrote together both passed all the tests and met the learning goals. I also made note of great highlights I saw. You both have earned a 🟢 on Adagrams!
def draw_letters(): | ||
pass | ||
''' | ||
input: none |
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.
Yay docstrings!
each letter in the LETTER_POOL | ||
''' | ||
hand = [] | ||
letter_freq = {} |
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.
Excellent use of a dictionary to keep track of letters and their frequencies
False otherwise or if char in word is not in hand. | ||
''' | ||
word = word.upper() | ||
hand_copy = copy.deepcopy(hand) |
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.
Great way to avoid side effects!
output: Returns True if each char is uniquely in hand. Returns | ||
False otherwise or if char in word is not in hand. | ||
''' | ||
word = word.upper() |
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! This will not introduce a side effect because strings are immutable!
played_word_dict[word] = score | ||
|
||
highest_score = max(played_word_dict.values()) | ||
best_word_list = [key for key, value in played_word_dict.items()\ |
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.
Lovely list comprehension!
No description provided.