ProgrammingHardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(len(str(10 ** 400 // 3)))
  1. A. 400
  2. B. 399
  3. C. 401
  4. D. 1

Correct answer: A. 400

10^400 divided by 3 is about 3.33 * 10^399, which has 400 digits. Integer division keeps the exact result.

More Python Programming questions

Exams that ask this topic