ProgrammingVery hardJEE Advanced · CAT placement

What is printed?

What is printed?
print(int(str(2**64) * 0 + '7') ** 2, len(str(7 ** 100)), 7 ** 100 % 10)
  1. A. 49 85 1
  2. B. 49 84 1
  3. C. 48 85 1
  4. D. 49 85 7

Correct answer: A. 49 85 1

Multiplying a string by 0 gives an empty string, so the int is 7 and its square is 49. 7**100 has 85 digits, and since 7**4 ends in 1, 7**100 also ends in 1.

More Python Programming questions

Exams that ask this topic