What is the quickest and cleanest way to convert an integer into a list?
integer
list
For example, change 132 into [1,3,2] an
132
[1,3,2]
num = list(str(100)) index = len(num) while index > 0: index -= 1 num[index] = int(num[index]) print(num)
It prints [1, 0, 0] object.
[1, 0, 0]