0

I am very new to programming and started learning my first programming language in python.

My code:

a=[0001,0052,1122,0127]

for i in a:
        nums = '{:05}'.format(i)
        print(nums)

Output :

00001
00042
01122
00087

Expected Output:

00001
00052
01122
00127

I am not getting what is wrong here.

Someone had closed the question but I am getting how can I do this? I tried this also,but not working. please help

for i in a:
        nums = '{:05}'.format(int(i, 8))
        print(nums)
Alfro
  • 458
  • 9
  • 22

0 Answers0