ProgrammingVery hardJEE Advanced · CAT placement

What is printed?

What is printed?
print(10 ** 50 // 3 ** 20 % 100, len(bin(10 ** 50)) - 2, (10 ** 50).bit_length())
  1. A. 61 167 167
  2. B. 61 166 167
  3. C. 60 167 167
  4. D. 61 167 166

Correct answer: A. 61 167 167

10**50 needs 167 bits, which both len(bin(...)) - 2 and bit_length() report. Floor division by 3**20 and % 100 are plain big-integer arithmetic, and the final two digits of the quotient are 61.

More Python Programming questions

Exams that ask this topic