ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(len(str(2 ** 64)), (2 ** 64).bit_length(), 2 ** 64 % 9, pow(2, 64, 9))
  1. A. 20 65 1 1
  2. B. 20 65 7 7
  3. C. 20 64 7 7
  4. D. 19 65 7 7

Correct answer: B. 20 65 7 7

2**64 = 18446744073709551616 has 20 digits. Its bit length is 65 because 2**64 is a single 1-bit at position 64. 2**64 mod 9 is 7, and pow with a modulus gives the same value.

More Python Programming questions

Exams that ask this topic