Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

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]
Comment

PREVIOUS NEXT
Code Example
Python :: mechanize python #4 
Python :: mechanize python #10 
Python :: mechanize python XE #27 
Python :: how to join models from another app 
Python :: how to get data from multiple tables in django 
Python :: sort dictionary by values 
Python :: (django)inorder to provide a human readable name for the model. 
Python :: pandas query return column 
Python :: how to insert ele in python 
Python :: ENUM AS STRING GODOT 
Python :: get inverse of bool value python 
Python :: apk calculate python 
Python :: How to avoit print() to go to newline each time 
Python :: quadkey calculator 
Python :: make seaborn plot larger to fit legend 
Python :: colorutils python 
Python :: unittest run one test 
Python :: looping emails using a database with python code 
Python :: Convert Int to String Using string formatting 
Python :: python finding mead 
Python :: install Social Auth App Flask 
Python :: python set vs tuple performance 
Python :: python sumproduct excel 
Python :: python split respect quotes 
Python :: Python NumPy ndarray.T Example 
Python :: odoo 15 documentation 
Python :: Python NumPy vstack Function Syntax 
Python :: Python NumPy dsplit Function 
Python :: __le__ 
Python :: godot knockback 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =