ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(int('11', 2) + int('11', 8) + int('11', 16))
  1. A. 29
  2. B. 26
  3. C. 30
  4. 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

Exams that ask this topic