Please use Python In this lab, you will: Instructions Scrabble is a word game in which words are constructed from letter
Posted: Fri May 20, 2022 6:31 pm
Please use Python
In this lab, you will:
Instructions
Scrabble is a word game in which words are constructed from
letter tiles, each letter tile containing a point value. The value
of a word is the sum of each tile's points added to any points
provided by the word's placement on the game board.
Write a program that takes a word as input and outputs the base
total value of the word by
calling count_scrabble_points().
Implement count_scrabble_points() to calculate the
total points for the given string (the function's parameter) and
return this total.
Example
If the input is:
the output is:
Why 14?
Because we look up the score for each letter and get
def count_scrabble_points(user_input):
"""
The function ...
"""
tile_dict = { '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 }
if __name__ == "__main__":
''' Type your code here. '''
In this lab, you will:
Instructions
Scrabble is a word game in which words are constructed from
letter tiles, each letter tile containing a point value. The value
of a word is the sum of each tile's points added to any points
provided by the word's placement on the game board.
Write a program that takes a word as input and outputs the base
total value of the word by
calling count_scrabble_points().
Implement count_scrabble_points() to calculate the
total points for the given string (the function's parameter) and
return this total.
Example
If the input is:
the output is:
Why 14?
Because we look up the score for each letter and get
def count_scrabble_points(user_input):
"""
The function ...
"""
tile_dict = { '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 }
if __name__ == "__main__":
''' Type your code here. '''