Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python seperate int into digit array

 pythonCopyimport math
n = 13579
x = [(n//(10**i))%10 for i in range(math.ceil(math.log(n, 10))-1, -1, -1)]
print(x)
# [1, 3, 5, 7, 9]
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #python #seperate #int #digit #array
ADD COMMENT
Topic
Name
3+9 =