🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Reviewing AI Code: all 10 questions

Quiz: Reviewing AI Code · Question 8 of 10

What does this print? (code)

What does this print?

print(round(0.1 + 0.2, 10) == 0.3, 0.1 + 0.2 == 0.3)
  1. A.True True
  2. B.False False
  3. C.False True
  4. D.True False
Answer & explanation

Correct answer: True False

Binary floats cannot store 0.1 and 0.2 exactly, so the direct comparison fails.

Can you get the rest right without peeking?

Take the timed Quiz: Reviewing AI Code quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →