Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

splitting a number into digits python

>>> n = 43365644 
>>> digits = [int(x) for x in str(n)]
>>> digits
[4, 3, 3, 6, 5, 6, 4, 4]
>>> lst.extend(digits)  # use the extends method if you want to add the list to another
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #splitting #number #digits #python
ADD COMMENT
Topic
Name
7+9 =