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(‘The sum of {0} and {1} is {2}’.format(2, 10, 12))

What will be the output of the following Python code snippet?
print(‘The sum of {0} and {1} is {2}’.format(2, 10, 12))
a) The sum of 2 and 10 is 12
b) Error
c) The sum of 0 and 1 is 2
d) None of the mentioned

Answer: a
Explanation: The arguments passed to the function format can be integers also.

Join The Discussion