ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(1_0.0_1, 0x1_F, 1_000.0e-3)
  1. A. 10.01 31 1000.0
  2. B. 1001 31 1.0
  3. C. 10.01 0x1F 1.0
  4. D. 10.01 31 1.0

Correct answer: D. 10.01 31 1.0

Underscores are allowed between digits in float, hex and exponent literals. 1_000.0e-3 is 1000 divided by 1000, which is 1.0.

More Python Programming questions

Exams that ask this topic