ProgrammingHardTCS NQT · Wipro pattern

What is printed?

What is printed?
print(10**20 / 10**19, 10**20 // 10**19, 2**64 % 1000, 10**20 == 1e20)
  1. A. 10.0 10 616 False
  2. B. 10 10 616 True
  3. C. 10.0 10 616 True
  4. D. 10.0 10 618 True

Correct answer: C. 10.0 10 616 True

/ always gives a float, while // keeps an int. 2^64 ends in 616, and 1e20 is exactly 10^20, so the comparison is True.

More Python Programming questions

Exams that ask this topic