Digit to Word
Sometimes a number needs to be shown to the user as a clear word instead of a digit. Write a function switch_it_up that takes a number number from 0 to 9 and returns its English name. For example, 0 becomes Zero, and 3 becomes Three.
Примеры
Ввод
1Вывод
"One"Ввод
3Вывод
"Three"Ввод
0Вывод
"Zero"Нужно реализовать
def switch_it_up(number: int) -> str:
Теги
stringsmath
Accedi per vedere la cronologia degli invii
AccediAccedi per usare l'AI Mentor
AccediVisible tests
1
Input
1Expected
"One"2
Input
3Expected
"Three"3
Input
0Expected
"Zero"4
Input
9Expected
"Nine"5
Input
5Expected
"Five"6
Input
-1Expected
"Nine"Focus radio
Paused · SomaFM · Fluid