Aug-23-2023, 08:52 AM
Just another way to pad with zeros - string method str.zfill(). It's actually more keystrokes than using f-string formatting but one can argue that more readable.
>>> for value in ("5", "25", "255", "2555"): ... print(value.zfill(3)) ... 005 025 255 2555
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.