def calc_word_value(word): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" sum = 0 for c in word: sum += LETTER_SCORES.get(c.upper(), 0) return sum
def calc_word_value(word): score = 0 for letter in (l.upper() for l in word): score += LETTER_SCORES.get(letter, 0) return score
def calc_word_value(input): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" return ft.reduce(lambda x, y: x + LETTER_SCORES.get(y.upper(), 0), input, 0)
def calc_word_value(word): """Calc a given word value based on Scrabble LETTER_SCORES mapping""" return sum(LETTER_SCORES.get(char.upper(), 0) for char in word)
def calc_word_value(word): """Calc a given word value based on Scrabble LETTER_SCORES mapping""" return sum(LETTER_SCORES.get(char.upper(), 0) for char in word)
def calc_word_value(word): return sum(LETTER_SCORES.get(char.upper(), 0) for char in word)
def calc_word_value(word): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" values = [LETTER_SCORES[letter.upper()] for letter in word if letter.upper() in LETTER_SCORES.keys()] return sum(values)
def calc_word_value(word): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" return sum(LETTER_SCORES.get(char, 0) for char in word.upper())
def calc_word_value(word): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" return sum(LETTER_SCORES.get(letter.capitalize(), 0) for letter in word)
def calc_word_value_with_reduce(word): return reduce( (lambda accum, char: accum + LETTER_SCORES.get(char.upper(), 0)), list(word), 0)
def calc_word_value(word): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" # Creates a list of numbers based the word arg and values per letter # Sums then returns total word value return sum(LETTER_SCORES.get(char.upper(), 0) for char in word)
def calc_word_value(thestr): """Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES""" letter_scores = [LETTER_SCORES.get(char.upper(), 0) for char in thestr] return sum(letter_scores)
def calc_word_value(word): #Calculate the value of the word entered into function using imported constant mapping LETTER_SCORES return sum(LETTER_SCORES.get(letter.upper(), 0) for letter in word)