Open
Conversation
tgoslee
reviewed
Oct 5, 2021
|
|
||
| letters_list=[] | ||
| import random | ||
| letters_dict = {'A' : 9, 'N' : 6, 'B' : 2, 'O' : 8, |
There was a problem hiding this comment.
I would suggest moving your letters_dict outside of your function and created a global constant variable. It just keeps your function clean and creates better readability.
tgoslee
reviewed
Oct 5, 2021
|
|
||
|
|
||
| # Wave 2 | ||
| def available_letters_quantity(letter_bank): |
tgoslee
reviewed
Oct 5, 2021
| Output: | ||
| boolean, True or False | ||
| ''' | ||
| letter_bank_dict = available_letters_quantity(letter_bank) |
tgoslee
reviewed
Oct 5, 2021
| Output: | ||
| sum, an integer; example: sum = 29 | ||
| ''' | ||
| letter_dict={1:['A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'], 2:['D','G'],3:['B', 'C', 'M', 'P' ],4:['F', 'H','V', 'W', 'Y'],5:['K'],8:['J','X'],10:['Q','Z']} |
There was a problem hiding this comment.
The same suggestion above to make this a constant global variable
tgoslee
reviewed
Oct 5, 2021
| words_and_scores_dict[word_list[i]] = {"score": score_word(word_list[i]), "word_list_index": i, "word_length": len(word_list[i])} | ||
| return words_and_scores_dict | ||
|
|
||
| def get_highest_word_score(word_list): |
There was a problem hiding this comment.
great use of a helper function and compound conditionals here
|
Great work!! I loved the use of helper functions and the use of your dictionaries! I left a comment on refactoring and how you approach some of the functions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.