Quiz Question 1 of 6
You are working with floating-point numbers in Python and notice that round(2.451, 2)
returns 2.45. Which of the following best describes the reason for this behavior?
Choose the correct answer below:
-
A
The round function only works for integer values and the result is coincidental.
-
B
Python is truncating the number to the nearest whole number.
-
C
Python does not support rounding to decimal places by default.
-
D
The floating-point number is approximated in binary, leading to a round-off error that affects the output.