← 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)
- A.True True
- B.False False
- C.False True
- 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 →