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

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

python - Received unregistered task using Celery with Django -