ProgrammingVery hardCAT · MBA placement

What is printed?

What is printed?
print(len(str(2**100)), str(2**100)[:5])
  1. A. 30 12676
  2. B. 31 12677
  3. C. 31 1267
  4. D. 31 12676

Correct answer: D. 31 12676

2^100 has 31 decimal digits and begins 12676, since 2^100 is 1267650600228229401496703205376.

More Python Programming questions

Exams that ask this topic