splitting a number into digits python

>>> n = 43365644
>>> [int(d) for d in str(n)]
[4, 3, 3, 6, 5, 6, 4, 4]
>>>

Here is what the above code is Doing:
1. We create a list called “digits”
2. We convert the number to a string
3. We iterate through the string
4. We convert each character to an integer
5. We add the integer to the list
6. We print the list

You can also use a list comprehension to create a list of integers from a list of strings:

>>> strings = [‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’]
>>> [int(s) for s in strings]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>>