ProgrammingHardTCS NQT · Infosys

What is printed?

What is printed?
print(pow(0, 0), 0 ** 0 == 1, pow(2, -2, 5), pow(0, 0, 5))
  1. A. 1 True 4 1
  2. B. 1 True 2 0
  3. C. 0 True 4 1
  4. D. 1 False 4 1

Correct answer: A. 1 True 4 1

Any number to the power 0 is 1, including 0 ** 0. pow(2, -2, 5) is the inverse of 4 mod 5, which is 4 since 4 * 4 = 16 is 1 mod 5. pow(0, 0, 5) is 1.

More Python Programming questions

Exams that ask this topic