Advertisement
here2share

# zero_padding.py

Nov 2nd, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. # zero_padding.py
  2.  
  3. print str(7).zfill(3)
  4.  
  5. # a more convenient way...
  6.  
  7. print "%02d and %03d" % (7,4)
  8. print "%03d" % (25)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement