ProgrammingVery hardProduct-company MCQ pattern

What is printed?

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

Correct answer: A. 1e+100 6 False

str of 1e100 uses exponent form, so the text is 1e+100 with six characters. The float 1e100 is not exactly 10**100, so the comparison with the int is False.

More Python Programming questions

Exams that ask this topic