ProgrammingVery hardJEE Advanced · CAT placement

What is printed?

What is printed?
print(len(str(float(10**300))), str(float(10**22))[:4], float(10**22) == 10**22)
  1. A. 6 1e+2 False
  2. B. 7 1e+22 True
  3. C. 6 1e+2 True
  4. D. 6 1e+3 True

Correct answer: C. 6 1e+2 True

float(10**300) prints as 1e+300, which has six characters. str(float(10**22)) is 1e+22, and its first four characters are 1e+2. 10**22 is exactly representable, so the comparison is True.

More Python Programming questions

Exams that ask this topic