Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Numbers padding in Python
#Title of this code #python 2.7.6 print "Hello, world!" # formatting numbers, padding # answers from stackoverflow.com # http://stackoverflow.com/questions/339007/nicest-way-to-pad-zeroes-to-string print "{0:03d}".format(5) # in python 2.6 print ("{0:03d}".format(5)) # in python 3 print format(4, '03') # python >= 2.6 print '%03d' % 5 print '%03i' % 5
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Fold an array
binary
information of operating system on which your code is run
project euler 16
single_digit_5
Python regex to find repetitive word count
Attempt to fork bomb server
сщые
PySet
how far light travels in centimeters in one nanosecond
Please log in to post a comment.