Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code snippet?
print(‘ab’.zfill(5))

What will be the output of the following Python code snippet?
print(‘ab’.zfill(5))
a) 000ab
b) 00ab0
c) 0ab00
d) ab000

Answer: a
Explanation: The string is padded with zeros on the left hand side. It is useful for formatting numbers.

Join The Discussion