I'm trying to prepend zeros to each number in a list if it isn't a the necessary number of digits.
lst = ['1234','2345']
for x in lst:
while len(x) < 5:
x = '0' + x
print(lst)
Ideally this would print ['012345', '02345']