I'm a bit confused about how rounding works in Python.
Can anyone explain why Python is behaving this way?
Example:
>>> round(0.05,1)
And the same for:
>>> round(0.25,1) # this makes sense 0.3 >>> round(0.35,1) # in my opinion, should be 0.4 but evaluates to 0.3 0.3
Edit: In general, it is likely that Python is rounded rather than rounded. So I have to understand that the only "abnormal" thing that can happen is that Python is rounded up? Or can it also round up โabnormallyโ because of how it is stored? (I did not find a case where Python was rounded, when I expected it to round)
source share