-
Notifications
You must be signed in to change notification settings - Fork 57
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
Maple - Monica and Mariama #37
base: master
Are you sure you want to change the base?
Conversation
|
||
letters_list=[] | ||
import random | ||
letters_dict = {'A' : 9, 'N' : 6, 'B' : 2, 'O' : 8, |
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.
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.
|
||
|
||
# Wave 2 | ||
def available_letters_quantity(letter_bank): |
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 use of a frequency map here
Output: | ||
boolean, True or False | ||
''' | ||
letter_bank_dict = available_letters_quantity(letter_bank) |
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 use of a helper function !
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same suggestion above to make this a constant global variable
words_and_scores_dict = {} | ||
for i in range(len(word_list)): | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
No description provided.