ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(len(str(2**64)), sum(map(int, str(2**64))))
  1. A. 20 87
  2. B. 20 88
  3. C. 19 88
  4. D. 20 89

Correct answer: B. 20 88

2**64 is 18446744073709551616, which has 20 digits. Its digits add up to 88, and the exact integer keeps every digit.

More Python Programming questions

Exams that ask this topic