files = input().split()
print(list(lambda a : '{0:0>7}'.format(a) if len(a) == 5 else '{0:0>8}'.format(a), files))
When I type 4.png, I want to print it out as "004.png" Line 2 keeps getting an error below. I don't know what's wrong with Google it(Crying)
An exception has occurred. TypeError list expected at most 1 arguments, got 2
python
list(map(lambda a : '{0:0>7}'.format(a) if a[-4] == '.' else '{0:0>8}'.format(a), files))
I have to write it like this. I'm asking and answering.
© 2025 OneMinuteCode. All rights reserved.