Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to format integer to two digit in python

You can achieve this using formatted string
num = 1
number = f"{num:02}"
--------------
output:
"01"
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #format #integer #digit #python
ADD COMMENT
Topic
Name
9+3 =