Left fill with zeros
print str(1).zfill(3);
# Expected output: 001
# Since python 3.6 you can use fstring :
number = 1
string_to_print = f"padded number: {number:05}"
print(string_to_print)
>>> padded number: 00001
Left fill with zeros
print str(1).zfill(3);
# Expected output: 001
# Since python 3.6 you can use fstring :
number = 1
string_to_print = f"padded number: {number:05}"
print(string_to_print)
>>> padded number: 00001
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us