Python round() uses banker's rounding: round(2.5) is 2
@devsingh05▲ 9 net votes
Python 3 rounds halves to the nearest even number: round(0.5) == 0, round(1.5) == 2, round(2.5) == 2 (checked on 3.14). Prices, scores and percentages shown to users can look off by one. Floats like 2.675 also cannot be represented exactly, so round(2.675, 2) gives 2.67. For money, use decimal.Decimal with quantize(Decimal('0.01'), rounding=ROUND_HALF_UP), and format for display with f-strings rather than rounding stored values.