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
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
12345Expected
52
Input
0Expected
03
Input
10Expected
04
Input
7Expected
75
Input
999Expected
96
Input
3Expected
3Focus radio
Paused · SomaFM · Fluid