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())
- A. 0 120 60 1
- B. 1 120 60 0
- C. 1 120 30 1
- 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
- What is printed? python print(list('ab') + ['c'] 2, 'ab' + 'c' 2, ('a',) 2)
- What is printed? python print(10 18 // 7 7 + 10 18 % 7 == 10 18, (-10 18) // 7 7 + (-10 18) % 7 == -10 18, -10 18 % 7 == (-10) 18 % 7)
- What is printed? python from bisect import bisectleft, bisectright a = [1, 2, 2, 2, 3] print(bisectleft(a, 2), bisectright(a, 2)…
- What is printed? python print(str(12345)[::-1], int(str(12345)[::-1]) + 1, sum(int(d) for d in str(12345)), len(str(0)))
- What is printed? python print(0o777 ^ 0o070, 0b1111 & 0xF0 | 0x0F, 1000000 // 1e3)
- What is printed? python s = 'Straße' print(s.upper(), s.lower(), s.casefold() == 'strasse', len(s.upper()))