-1

I have various inputs like below,i need to make any given digit as four letter and append leading zeroes to make it four digit and add a "00.00" at the front,can any suggest how to do this?

INPUT:-

val = int(95)
val = int(115)
val = int(5)


EXPECTED OUTPUT:-

00.00.0095
00.00.0115
00.00.0005
vorsicht t
  • 33
  • 1
  • 4

1 Answers1

1

You could do like this, assuming 00.00 is always constant.

print(["00.00.{:>04d}".format(v) for v in [95, 115, 5]])
# ['00.00.0095', '00.00.0115', '00.00.0005']
Marcin
  • 215,873
  • 14
  • 235
  • 294