-
Notifications
You must be signed in to change notification settings - Fork 69
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
C17 - Otters - Doina and Taingleap #47
base: master
Are you sure you want to change the base?
Conversation
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 job!
Your code is clear and easy to read, well done!
# shuffle the list | ||
random.shuffle(letter_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.
Nice use of random.shuffle
!
SCORE_CHART = {'A': 1,'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, | ||
'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 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.
Style: It's good practice to put global constants like this up near the top of the file (under the imports).
for letter in word.upper(): | ||
if letter in SCORE_CHART: | ||
score += SCORE_CHART[letter] |
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.
You can make this slightly cleaner by using get
:
for letter in word.upper(): | |
if letter in SCORE_CHART: | |
score += SCORE_CHART[letter] | |
for letter in word.upper(): | |
score += SCORE_CHART.get(letter, 0) |
No description provided.