Sha256: ae878a71bdf11acb3f8669ee0799bbb8748ece21c542783d483b68692c721e30

Contents?: true

Size: 367 Bytes

Versions: 396

Compression:

Stored size: 367 Bytes

Contents

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):
    if not word.isalpha():
        return 0
    return sum(POINTS[letter] for letter in word.lower())

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.179 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.178 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.177 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.176 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.175 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.174 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.173 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.172 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.171 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.170 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.169 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.167 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.166 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.165 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.164 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.163 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.162 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.161 tracks/python/exercises/scrabble-score/example.py
trackler-2.2.1.160 tracks/python/exercises/scrabble-score/example.py