ProgrammingHardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(len(str(2 ** 1000 * 5 ** 1000)))
  1. A. 302
  2. B. 1000
  3. C. 1001
  4. D. 1002

Correct answer: C. 1001

2**1000 * 5**1000 = 10**1000, which has 1001 digits. A naive guess would use the size of 2**1000, which has only 302 digits.

More Python Programming questions

Exams that ask this topic