ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
print(len(str(7**1000)), 7**1000 % 10)
  1. A. 846 1
  2. B. 846 7
  3. C. 845 1
  4. D. 847 1

Correct answer: A. 846 1

7 to the power 1000 has 846 digits. The last digit of powers of 7 repeats 7, 9, 3, 1, and 1000 is a multiple of four, so the last digit is 1.

More Python Programming questions

Exams that ask this topic