Which of the following statements about floats in Python is true?
-
A
Floats cannot represent negative numbers.
-
B
Floats have infinite precision.
-
C
Floats are always displayed with a fixed number of decimal places.
-
D
Floats can be used to represent fractions accurately.
Correct answer
Correct answer
D. Floats can be used to represent fractions accurately.
14 views
Explanation
Floats can represent fractions accurately, but they have limited precision due to their binary representation.
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ