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

C17 - Otters - Doina and Taingleap #47

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

Conversation

taingleapchheang
Copy link

No description provided.

Copy link

@kaidamasaki kaidamasaki left a 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!

Comment on lines +40 to +41
# shuffle the list
random.shuffle(letter_list)

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!

Comment on lines +60 to +61
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}

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).

Comment on lines +66 to +68
for letter in word.upper():
if letter in SCORE_CHART:
score += SCORE_CHART[letter]

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:

Suggested change
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)

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