Word Score
In Scrabble, each letter has its own point value, so a word’s total score is the sum of its letter scores. The function score receives a word word and calculates its Scrabble score. Letter case does not matter, so lowercase and uppercase letters should be scored the same way.
Примеры
Ввод
"a"Вывод
1Ввод
"cabbage"Вывод
14Ввод
"quirky"Вывод
22Нужно реализовать
def score(word: str) -> int:
Теги
stringsdict
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seVisible tests
1
Input
"a"Expected
12
Input
"cabbage"Expected
143
Input
"quirky"Expected
224
Input
"OxyphenButazone"Expected
415
Input
""Expected
06
Input
"!"Expected
0Focus radio
Paused · SomaFM · Fluid