ProgrammingModerateTCS NQT · Infosys

What is printed?

What is printed?
print(0.1 + 0.2 == 0.3 or 'no', 0.5 + 0.25 == 0.75 and 'yes')
  1. A. no yes
  2. B. yes no
  3. C. no no
  4. D. no False

Correct answer: A. no yes

0.1 + 0.2 == 0.3 is False, so the or returns its right operand 'no'. 0.5 + 0.25 == 0.75 is True, so the and returns 'yes'.

More Python Programming questions

Exams that ask this topic