Run Code
|
API
|
Code Wall
|
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
fb_series
Nun
Problem: fb_series
Aufgabe 16
Problem: fb_series
Prime number finder and counter in range (ex: 0-100) using python
fibonacci_2
single_digit
Project Euler #22
Python examples - SIMPLE