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 -

python - Received unregistered task using Celery with Django -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -