Digits in Reverse

Sometimes you need to break a number into separate digits so you can work with them as a list. Write digitize, which takes a non-negative number n and returns its digits in reverse order. That means the last digit comes first, then the digit before it, and so on.

Примеры

Ввод
35231
Вывод
[1, 3, 2, 5, 3]
Ввод
0
Вывод
[0]
Ввод
123
Вывод
[3, 2, 1]

Нужно реализовать

def digitize(n: int) -> list[int]:

Теги

mathlistsarray
PostgreSQLv16

Taispeánfar toradh do chóid anseo

Visible tests
1
Input
35231
Expected[1,3,2,5,3]
2
Input
0
Expected[0]
3
Input
123
Expected[3,2,1]
4
Input
1
Expected[1]
5
Input
1000
Expected[0,0,0,1]
6
Input
999999
Expected[9,9,9,9,9,9]
Focus radio
Paused · SomaFM · Fluid