Python round() Function

Python round() function rounds off the digits of a number and returns the floating-point number.

Signature

Parameters

number : The number that is to be rounded.

digits : It is the number for which the given number is to be rounded, and it is an optional parameter.

Return

It rounds-off a number and returns the value as output.

Let's see some examples of round() function which are given below:

Python round() Function Example 1

This example shows working of the round() function in Python:

Output:

10
11
7

Python round() Function Example 2

This example shows round-off a number to given n digits places:

Output:

2.67
2.67





Latest Courses