-2

I am relatively new to Python and started learning from basics. I was practicing python in Python 3.10.4 and noticed some strange behaviour as per the following lines below:

>>> round(2.5)
2
>>> round(3.5)
4
>>> round(4.5)
4
>>> round(5.5)
6

the odd numbered decimals rounded to one higher and even ones were floor to same, it is primitive of round() method or something different?

Woodford
  • 2,796
  • 1
  • 11
  • 25

0 Answers0