Answer the question
In order to leave comments, you need to log in
How to turn a number into a list?
a = 8299
I need this number to be in the list
I did not find an adequate method on the Internet [8, 2, 9, 9]
Answer the question
In order to leave comments, you need to log in
Here
is Option 1:
a = 8299
a = str(a)
spicoc = list(a)
print(spicoc) #['8', '2', '9', '9']
a = 8299
a = str(a)
spisoc = []
for i in a :
spisoc.append(int(i)) # int если нужно что бы элемент сразу был числом
print(spisoc)# [8, 2, 9, 9]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question