ProgrammingModerateTCS NQT · Wipro pattern

What is printed?

What is printed?
print(int('0009'), float('009.50'), int(' -0 '), str(-0))
  1. A. 9 9.5 0 0
  2. B. 9 9.50 0 0
  3. C. 9 9.5 1 0
  4. D. 9 9.5 0 -1

Correct answer: A. 9 9.5 0 0

Leading zeros are allowed in int() and float() decimal literals, and int(' -0 ') is 0. str(-0) is just '0' because integers have no negative zero.

More Python Programming questions

Exams that ask this topic