Maybe join
+split
:
>>> a=12345
>>> list(map(int,' '.join(str(a)).split()))
[1, 2, 3, 4, 5]
>>> [int(i) for i in ' '.join(str(a)).split()]
[1, 2, 3, 4, 5]
>>>
str.join
+ str.split
is your friend, also we use map
or list comprehension
to get a list, (split what we join :-)).