convert number to formatted string in python with prefix 0s -


i want convert number in python 3 character string, prefix 0s. example:

8  = "008" 12 = "012" 6  = "006" 

thanks

just use:

format(number, '03') 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -