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

Line ending issue with Mercurial or Visual Studio -

java - Jtable duplicate Rows -

java - Run a .jar on Heroku -