ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
import math
print(math.gcd(2**40 - 1, 2**20 - 1) == 2**20 - 1, math.lcm(12, 18) == 36, math.gcd(10**30, 10**20) == 10**20)
  1. A. True True False
  2. B. False True True
  3. C. True False True
  4. D. True True True

Correct answer: D. True True True

2**20 - 1 divides 2**40 - 1 because 20 divides 40, so the gcd is the smaller value. Big ints give exact results, and 10**20 divides 10**30.

More Python Programming questions

Exams that ask this topic