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:b} and {1:x} is {2:o}’.format(2, 10, 12))

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

Answer: b
Explanation: 2 is converted to binary, 10 to hexadecimal and 12 to octal.

Join The Discussion