2021年4月6日星期二

using dictionary and summing

I am supposed to get 14 as the output when I input PYTHON. It says no output is produced.

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 }            def points(scrabble):      summ=0      for x in scrabble:         summ+=tile_dict[x]       return summ  
https://stackoverflow.com/questions/66978628/using-dictionary-and-summing April 07, 2021 at 10:02AM

没有评论:

发表评论