Skip to content
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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

mcatcruz
Copy link

No description provided.


letters_list=[]
import random
letters_dict = {'A' : 9, 'N' : 6, 'B' : 2, 'O' : 8,
Copy link

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

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

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']}
Copy link

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

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

@tgoslee
Copy link

tgoslee commented Oct 5, 2021

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.

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