python split number into individual digits
Python[Edit]
+
0
-
0
python split number into individual digits
1 2 3 4 5number = 1234 result = [int(digit) for digit in str(number)] print(result) # [1, 2, 3, 4]
[Edit]
+
0
-
0
python split number into individual digits
1 2 3 4 5 6 7def split(number): return [digit for digit in number] num = 12345 print(split(str(num))) # ['1', '2', '3', '4', '5']