ProgrammingVery hardTCS NQT · Wipro pattern
What is printed?
What is printed?
print('%.3e' % 12345.678)- A. 1.234e+04
- B. 12345.678
- C. 1.235e4
- 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
- What is printed? python print(sorted([3, 1, 2], reverse=True) == [3, 2, 1], [3, 1, 2][::-1])
- What is printed? python print([0] 3 == [0, 0, 0], [[]] 2 == [[], []])
- What is printed? python print(len([x for x in range(100) if x % 7 == 0]), sum(range(0, 100, 7)))
- What is printed? python print(round(-2.5), round(-3.5), round(-2.5 - 1e-9))
- What is printed? python print(7 -1 7, (7 -1) 7 == 1.0)
- What is printed? python print(int('0o777', 8) == 511, int('777', 8) - int('0o777', 0))