C17 Whales Adagrams - Natascha Jenkins, Mandy Gao, Morgan Adkisson#42
C17 Whales Adagrams - Natascha Jenkins, Mandy Gao, Morgan Adkisson#42MorganAdkisson wants to merge 21 commits intoada-c17:masterfrom
Conversation
… work to pass all tests
jericahuang
left a comment
There was a problem hiding this comment.
Great work on this project, Natascha, Mandy and Morgan! The code you wrote together both passed all the tests and met the learning goals. I see awesome git collaboration from the commit history and I made line-by-line notes of great highlights I saw. You all have earned a 🟢 on Adagrams!
| def uses_available_letters(word, letter_bank): | ||
| pass | ||
|
|
||
| copy_letter_bank = letter_bank.copy() |
There was a problem hiding this comment.
Nice use of .copy() to avoid side effects!
| # Invoking this function should not change the pool of letters | ||
|
|
||
| all_letters = [] | ||
| letter_a = all_letters.extend(repeat('A', 9)) |
There was a problem hiding this comment.
Very cool letters pool implementation using repeat!
|
|
||
| if len(word.upper()) >= 7 and len(word.upper()) <= 10: | ||
| return (sum(points_for_each_letter)+bonus) | ||
| else: |
| def score_word(word): | ||
| pass | ||
|
|
||
| letters_and_point_values = { |
There was a problem hiding this comment.
A dict is a great data type to track the letter and point values!
|
|
||
| def get_highest_word_score(word_list): | ||
| pass No newline at end of file | ||
| scores = [score_word(word) for word in word_list] |
There was a problem hiding this comment.
Lovely list comprehension and helper function usage!
| def get_highest_word_score(word_list): | ||
| pass No newline at end of file | ||
| scores = [score_word(word) for word in word_list] | ||
| word_and_score = sorted(list(zip(word_list, scores)), reverse = True) |
There was a problem hiding this comment.
Wonderful use of .sorted(), .list(), and .zip()!
| assert best_word[1] == 18 | ||
|
|
||
| def test_get_highest_word_tie_prefers_shorter_word_our_test(): | ||
| #tests for shortest word indepedent of position in alphabet |
No description provided.