ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(len(str(2**64)), 2**64 // 10**19, 2**64 % 10**19, len(str(2**64 - 1)))
  1. A. 20 1 8446744073709551615 20
  2. B. 19 1 8446744073709551616 20
  3. C. 20 1 8446744073709551616 20
  4. D. 20 2 8446744073709551616 20

Correct answer: C. 20 1 8446744073709551616 20

2**64 is 18446744073709551616, which has 20 digits. Integer floor division and modulus by 10**19 split off the leading digit, leaving 8446744073709551616.

More Python Programming questions

Exams that ask this topic