ProgrammingModerateTCS NQT · Wipro pattern

What is printed?

What is printed?
print(len(str(10**100 - 1)), str(10**5)[:3], int('9' * 50) % 9)
  1. A. 100 100 0
  2. B. 99 100 0
  3. C. 100 10 0
  4. D. 100 100 9

Correct answer: A. 100 100 0

10**100 - 1 is one hundred nines, so its length is 100. A string of nines has a digit sum of 9 times its length, so it is divisible by 9.

More Python Programming questions

Exams that ask this topic