ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
import math
print(len(str(math.factorial(200))))
  1. A. 376
  2. B. 200
  3. C. 375
  4. D. 374

Correct answer: C. 375

200! is about 7.88 * 10^374, so it has 375 digits. The digit count is len(str(...)) with no need to count by hand.

More Python Programming questions

Exams that ask this topic