ProgrammingVery hardTCS NQT · Wipro pattern

What is printed?

What is printed?
print('%.3e' % 12345.678)
  1. A. 1.234e+04
  2. B. 12345.678
  3. C. 1.235e4
  4. D. 1.235e+04

Correct answer: D. 1.235e+04

The e format keeps three digits after the point in scientific notation, rounding 1.2345678 up to 1.235, and it always writes an exponent with a sign and at least two digits.

More Python Programming questions

Exams that ask this topic