-
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- Adah Hailemariam and Genie Arcila #45
base: master
Are you sure you want to change the base?
Conversation
|
||
letter_list = ['A','A','A','A','A','A','A','A','A','B','B', |
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 making your letter_list a global constant variable LETTER_LIST
this would clean up your function and remind yourself/other developers this should not be changed
'T','T','T','T','T', 'U', 'U', 'U', 'U', 'V', 'V', 'W','W', 'X', 'Y','Y','Z'] | ||
letters = letter_list.copy() | ||
chosen_letters = [] | ||
for i in range(10): |
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.
instead of a for loop, you could use a while loop that will continue until the length of chosen_letters
is less than 10.
def uses_available_letters(word, letter_bank): | ||
pass | ||
|
||
letters_used = letter_bank.copy() |
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 for making a copy! Definitely want to avoid side effects.
letters_used.remove(letter) | ||
else: | ||
return False | ||
break |
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 break is unnecessary here. Once you return False the code after will be unreachable.
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.
great way to group the data that was given
sum += score | ||
if word_length >= 7: | ||
sum += 8 | ||
return sum | ||
|
||
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 way to approach finding the highest score.
Great work to both of you. I added comments on refactoring some of your code and how you approached the problems. |
No description provided.