ProgrammingVery hardJEE Main · CAT placement

What is printed?

What is printed?
import math
print(math.prod([]), math.prod(range(1, 6)), math.lcm(*range(1, 6)), math.lcm())
  1. A. 0 120 60 1
  2. B. 1 120 60 0
  3. C. 1 120 30 1
  4. D. 1 120 60 1

Correct answer: D. 1 120 60 1

The empty product is 1, and 5! is 120. The least common multiple of 1 to 5 is 60, and lcm() with no arguments is the identity 1.

More Python Programming questions

Exams that ask this topic