ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(int(str(7) * 3) ** 2 % 10, 111 ** 2, (11 ** 2) * 10 + 1)
  1. A. 1 12321 1211
  2. B. 9 12311 1211
  3. C. 9 12321 1221
  4. D. 9 12321 1211

Correct answer: D. 9 12321 1211

777 squared ends in 9 because 7 squared ends in 9. 111 squared is 12321, and 121 * 10 + 1 is 1211.

More Python Programming questions

Exams that ask this topic