ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(str(10 ** 15 / 10), str(10 ** 16 / 10), 10 ** 16 // 10)
  1. A. 1e+14 1e+15 1000000000000000
  2. B. 100000000000000.0 1e+15 1000000000000000
  3. C. 100000000000000 1000000000000000.0 1000000000000000
  4. D. 100000000000000.0 1000000000000000.0 1000000000000000

Correct answer: D. 100000000000000.0 1000000000000000.0 1000000000000000

Floats below 1e16 print in full decimal form, so 1e14 and 1e15 appear as 100000000000000.0 and 1000000000000000.0. Floor division of two ints stays an int.

More Python Programming questions

Exams that ask this topic