I have a Python list on int types:
list1 = [1, 2, 3, 4, 10, 100]
I need to get another list of the above list values but with equal width like:
list2 = ['001', '002', '003', '004', '010', '100']
I can do this by looping through list1
values, converting them to strings, finding their lengths and appending 0's in-front of the values but this is a bit long process, is there any better way to do this?