Number as Text
Programs often need to turn numbers into text, for example to show them on the screen or combine them with another string. Write a function number_to_string that takes a number num and returns its string representation. For negative numbers, the minus sign should be kept.
Примеры
Ввод
67Вывод
"67"Ввод
0Вывод
"0"Ввод
-1Вывод
"-1"Нужно реализовать
def number_to_string(num: int) -> str:
Теги
stringsmath
Logga in för att se historik över inskick
Logga inLogga in för att använda AI-mentorn
Logga inVisible tests
1
Input
67Expected
"67"2
Input
0Expected
"0"3
Input
-1Expected
"-1"4
Input
123456Expected
"123456"5
Input
42Expected
"42"6
Input
-100Expected
"-100"Focus radio
Paused · SomaFM · Fluid