ProgrammingVery hardProduct-company MCQ pattern

What is printed?

What is printed?
print('%d' % 10**20, '%.3e' % (2**70), len('%d' % (2**100)), '%x' % (2**70))
  1. A. 100000000000000000000 1.181e+20 31 400000000000000000
  2. B. 100000000000000000000 1.181e+21 30 400000000000000000
  3. C. 100000000000000000000 1.181e+21 31 40000000000000000
  4. D. 100000000000000000000 1.181e+21 31 400000000000000000

Correct answer: D. 100000000000000000000 1.181e+21 31 400000000000000000

2**70 is about 1.181e21, and 2**100 has 31 digits. In hex, 2**70 is a 4 followed by 17 zeros, since 70 = 2 + 4 * 17.

More Python Programming questions

Exams that ask this topic