What is the output of print('42'.zfill(5)) in Python?
print('42'.zfill(5))
Correct answer
A. 00042
5 views
A. 00042
5 views
zfill() pads a numeric string with zeros on the left.
Asked in: Python Interview Strings
https://docs.python.org/3/library/stdtypes.html#string-methodsNot sure why the answer is A? Ask here and get an explanation.