Scrabble Score

From Exercism PythonMITOriginal pagePython1 class period1 exercise11 graded tests

README.md

Scrabble Score

Introduction

Scrabble is a word game where players place letter tiles on a board to form words. Each letter has a value. A word's score is the sum of its letters' values.

Instructions

Your task is to compute a word's Scrabble score by summing the values of its letters.

The letters are valued as follows:

LetterValue
A, E, I, O, U, L, N, R, S, T1
D, G2
B, C, M, P3
F, H, V, W, Y4
K5
J, X8
Q, Z10

For example, the word "cabbage" is worth 14 points:

  • 3 points for C
  • 1 point for A
  • 3 points for B
  • 3 points for B
  • 1 point for A
  • 2 points for G
  • 1 point for E

Open the 01 folder and edit main.py. Run Tests checks it.

For teachers

Scrabble Score

Students solve Exercism's “Scrabble Score” Python exercise in CS Room, with Exercism's own tests.

  • Time: 1 class period
  • Tests: 11, set up for you when you import the lesson
  • Practices: regular-expressions