Data Structures & AlgorithmsModerateTCS NQT Digital · Python semantics

Problem: What does the following print?

Problem: What does the following print?
print(10 ** 20 // 10 ** 18)
What is printed?
  1. A. 1000
  2. B. 10
  3. C. 10000
  4. D. 100

Correct answer: D. 100

10**20 // 10**18 = 10**2 = 100 exactly, because Python integers do not overflow.

More Coding Interview Problems questions

Exams that ask this topic