1. Home
  2. Data Science
  3. Python
  4. What is the output of print(0.1 + 0.2 == 0.3) in Python?

Added 25 Nov 2026

What is the output of print(0.1 + 0.2 == 0.3) in Python?

print(0.1 + 0.2 == 0.3)
  1. True
  2. Error
  3. False Correct answer
  4. None

Correct answer

C. False

5 views

MCQSEXAM

Explanation

Binary floating-point cannot represent 0.1 and 0.2 exactly, so the sum is 0.30000000000000004.

Reference

Asked in: Python Interview Data Types

https://docs.python.org/3/library/stdtypes.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs