ProgrammingVery hardTCS NQT · Accenture

What is printed?

What is printed?
print(1000000 * 1000000 == 10**12, 0.1 * 0.1 * 100 == 1, round(0.1 * 0.1 * 100, 10) == 1.0, 2 ** 0.5 == 2 ** (1 / 2))
  1. A. True False True True
  2. B. True True True True
  3. C. False False True True
  4. D. True False False True

Correct answer: A. True False True True

Integer multiplication is exact, so the first check is True. 0.1 * 0.1 * 100 is just above 1, and rounding to ten places fixes it. ** with 0.5 and 1 / 2 is the same exponent.

More Python Programming questions

Exams that ask this topic