Source From Here
Question
Given:
How do I
display a leading zero for all numbers with less than two digits? That is,
How-To
One approach is to use Format feature from string class:
Or you can use str.zfill:
Question
Given:
- a = 1
- b = 10
- c = 100
How-To
One approach is to use Format feature from string class:
Or you can use str.zfill:
沒有留言:
張貼留言