id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

scrabble


Given a string, return its English Scrabble score. The Scrabble score is the sum of the Scrabble values of the string's letters (https://en.wikipedia.org/wiki/Scrabble_letter_distributions#English). You can use the following dictionary for the Scrabble values of letters:

value = {'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' : 2, 'q' : 10, 'r' : 1,
         's' : 1, 't' : 1, 'u' : 1, 'v' : 4, 'w' : 4, 'x' : 8,
         'y' : 4, 'z' : 10}
Strings will only contain lowercase letters.

scrabble('hello') → 8
scrabble('capybara') → 16
scrabble('') → 0

...Save, Compile, Run (ctrl-enter)

def scrabble(word):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy