ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
x = 1 << 200
print(x.bit_length(), len(str(x)), x % 1000, (x >> 190) & 0xFF)
  1. A. 201 61 376 1024
  2. B. 200 61 376 0
  3. C. 201 61 376 0
  4. D. 201 60 376 0

Correct answer: C. 201 61 376 0

1 << 200 has bit length 201 and 61 decimal digits. Its last three digits are 376, and shifting right by 190 leaves 2**10, which is 0 after masking with 0xFF.

More Python Programming questions

Exams that ask this topic