Python round() Function
Definition and Usage
The round() function returns a floating-point number, which is the rounded version of the specified number with the specified number of decimal places.
The default number of decimal places is 0, indicating that the function will return the nearest integer.
Syntax
round(number, digits)
Parameter Value
Parameter | Description |
---|---|
number | Required. The number to be rounded. |
digits | Optional. The number of decimal places to use when rounding. The default is 0. |