#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov  1 06:53:22 2017

@author: Jake
"""

def getWordScore(word, n):
    
    """
    Returns the score for a word. Assumes the word is a valid word.

    The score for a word is the sum of the points for letters in the
    word, multiplied by the length of the word, PLUS 50 points if all n
    letters are used on the first turn.

    Letters are scored as in Scrabble; A is worth 1, B is worth 3, C is
    worth 3, D is worth 2, E is worth 1, and so on (see SCRABBLE_LETTER_VALUES)

    word: string (lowercase letters)
    n: integer (HAND_SIZE; i.e., hand size required for additional points)
    returns: int >= 0
    """
    
## DON'T FORGET TO DELETE THIS ##
    
    SCRABBLE_LETTER_VALUES = {
    '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
}

## DELETE ABOVE THIS ##
    
    letter_score = 0
    word_score = 0
    
    for letter in word:
        letter_score += SCRABBLE_LETTER_VALUES[letter]
    
    word_score = letter_score * len(word)
    
    if len(word) == n:
        word_score += 50
        
    return word_score

## DELETE BELOW THIS LINE WHEN IT WORKS ##

word = 'fork'
HAND_SIZE = 7

n = HAND_SIZE

print(getWordScore(word, n))