1. Home
  2. Data Science
  3. Python
  4. What will be the result of 0.1 + 0.2 == 0.3 in Python?

Added 4 May 2024

What will be the result of 0.1 + 0.2 == 0.3 in Python?

  1. True
  2. False Correct answer
  3. Error
  4. Undefined

Correct answer

B. False

15 views

MCQSEXAM

Explanation

Due to floating-point representation limitations, 0.1 + 0.2 is not exactly equal to 0.3.

Doubts & discussion

Not sure why the answer is B? 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