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
# 1. Word Scores | |
def getWordScore(word, n): | |
return (len(word) * sum(SCRABBLE_LETTER_VALUES[x] for x in word)) + (50 if len(word) == n else 0) | |
# Test implementation | |
def getFrequencyDict(aStr): | |
return dict((letter, aStr.count(letter)) for letter in aStr) | |
# 2. Dealing with hands | |
def updateHand(hand, word): |