Python ProgrammingPython Programming

Format integer as string with leading zeros in Python?

x = 4
x = str(x).zfill(5)
print(x)
Output
00004