What is the most Pythonic way to pad a numeric string with zeroes to the left, i.e., so the numeric string has a specific length?
Russell Y.
answered 08/10/20
Try this
>>> n = '77'
>>> print(n.zfill(3))
0077
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.