Help LEARN PYTHON 3 Scrabble Project

Want to check if there’s any error in my code and how to enhance it please:

letters = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
points = [1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 4, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10]

letter_to_points={letter:point for letter,point in zip(letters,points)}
# print(letter_to_points)
letter_to_points.update({" ":0})
def score_word(word):
  point_total=0
  for letter in word:
    point_total+=letter_to_points[letter]
  return point_total

brownie_points=score_word("BROWNIE")
print(brownie_points)
    
player_to_words={"BLUE":["EARTH", "ERASER", "ZAP"], 
"TENNIS":["EYES","BELLY","COMA"],"EXIT":["MACHINE"	,"HUSKY","PERIOD"] }
player_to_points={}
for item in player_to_words.items():
  player=item[0]
  words=item[1]
  player_points=0
  for word in words:
    player_points+=score_word(word)
  player_to_points.update({player:player_points})
print(player_to_points)
def play_word(player,word):
  if word not in player_to_words[player]
  player_to_words[player].append(word)


  


I think you’re missing some code at the bottom in the play_word function.

Also, in the score_word function, you have to account for 0 in the point_total. The directions: “You should get the point value from the letter_to_points dictionary. If the letter you are checking for is not in letter_to_points, add 0 to the point_total.”

here:

point_total+=letter_to_points[letter]

Also, why is “[letter]” in brackets and not parens?

I new at this, but it looks good to me.
Are you not allowed to have the same word twice in scrabble?
I tend to fuss over projects after I’ve finished, reading through forum posts to see different ways people wrote the code and appending my project to make sure I understand them. This is how I defined play_word before and after.

def play_word(player, word):
  #new_words = player_to_words[player]
  #new_words.append(word)
  #player_to_words.update({player: new_words})
  player_to_words[player].append(word)

I’m not sure how much it matters, but if you use .get() in score_word your function can handle erroeous input.

def score_word(word):
  point_total = 0
  for letter in word:
    point_total += letter_to_points.get(letter.upper(), 0)
    #point_total += letter_to_points[letter.upper()]
  return point_total
brownie_points = score_word("bROWNIE #%^&")