Created
February 23, 2021 19:12
-
-
Save cbscribe/5277fb31c6af4200aea102e8ce43da42 to your computer and use it in GitHub Desktop.
Scrabble lab starting code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Points assigned to each letter of the alphabet | |
POINTS = {"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} | |
def score(word): | |
# TODO: Compute and return score for a word | |
score = 0 | |
return score | |
# Get input words from both players | |
p1 = input("Player 1: ") | |
p2 = input("Player 2: ") | |
# Score both words | |
s1 = score(p1) | |
s2 = score(p2) | |
# TODO: Print the winner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment