ProgrammingHardTCS NQT · Infosys

What is printed?

What is printed?
print(len(str(2 ** 64)), str(2 ** 64)[:4], 2 ** 64 % 1000)
  1. A. 19 1844 616
  2. B. 20 1844 616
  3. C. 20 1844 615
  4. D. 20 1845 616

Correct answer: B. 20 1844 616

2**64 has twenty digits, and its first four digits are 1844. The last three digits are 616.

More Python Programming questions

Exams that ask this topic