Skip to navigation
Add leading zeros null to number under 10 in python
05.05.21
add leading zeros null to number under 10 in python You can use the builtin str.zfill method, like this my_string = "1" print my_string.zfill(2) # Prints 01 my_string = "1000" print my_string.zfill(2) # Prints 100
https://stackoverflow.com/questions/21620602/add-leading-zero-python
Reply
Anonymous
Information Epoch 1753630046
Silence is golden.
Home
Notebook
Contact us