What will be the result of 0.1 + 0.2 == 0.3 in Python?
-
A
True
-
B
False
Correct answer
-
C
Error
-
D
Undefined
15 views
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