ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
import math
print(math.comb(100, 50) % 1000, len(str(math.comb(100, 50))), math.perm(5, 2), math.comb(5, 7))
  1. A. 256 30 20 1
  2. B. 256 29 20 0
  3. C. 256 30 20 0
  4. D. 256 30 25 0

Correct answer: C. 256 30 20 0

comb(100, 50) has 30 digits, and it ends in 256 mod 1000. perm(5, 2) is 5 * 4 = 20, and comb returns 0 when k is larger than n.

More Python Programming questions

Exams that ask this topic