ProgrammingModerateTCS NQT · Infosys
What is printed?
What is printed?
print(int('11', 2) + int('11', 8) + int('11', 16))- A. 29
- B. 26
- C. 30
- D. 25
Correct answer: A. 29
'11' is 3 in base 2, 9 in base 8 and 17 in base 16, so the sum is 3 + 9 + 17 = 29.
More Python Programming questions
- What is printed? python print(round(1234.5678, -2), round(-1234.5678, 2), round(0.000123456, 5))
- What is printed? python print(7 / 7, 0 / 5, -0 / 5, 2 0, 0 0.0)
- What is printed? python print(7 // 1.0 1, 1e3 // 7, -1e3 // 7, 10 % -3.0)
- What is printed? python print(bool(''), bool('False'), bool([]), bool([[]]), bool(None))
- What is printed? python print(str(3) + str(3.0), 3 + 3.0, '3' 3 == '333')
- What is printed? python y = 1 + 1 - 1 2 2 // 4 print(y, 2 2 0, (2 2) 0, -3 2 % 5)