Final Digit
The last digit of a number is useful in many checks, such as detecting even numbers or processing an ID piece by piece. Write a function last_digit that takes a non-negative integer n. Return its last digit.
Примеры
Ввод
12345Вывод
5Ввод
0Вывод
0Ввод
10Вывод
0Нужно реализовать
def last_digit(n: int) -> int:
Теги
math
Idħol biex tara l-istorja tas-sottomissjonijiet
IdħolIdħol biex tuża l-Mentor tal-AI
IdħolVisible tests
1
Input
12345Expected
52
Input
0Expected
03
Input
10Expected
04
Input
7Expected
75
Input
999Expected
96
Input
3Expected
3Focus radio
Paused · SomaFM · Fluid