ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy

What is printed?

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

Correct answer: A. 0 1 1

Any number modulo 1 is 0, so pow(3, 0, 1) is 0 even though 3**0 is 1. Python defines 0 ** 0 as 1.

More Python Programming questions

Exams that ask this topic