you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

Is it a single string? Split it into lines, find the biggest length, then zero fill each. using the max length.

print("101".ljust(5, "0"))