# Python Number round() Method

#### Beyond Basic Programming - Intermediate Python

Most Popular

36 Lectures 3 hours

#### Practical Machine Learning using Python

Best Seller

91 Lectures 23.5 hours

#### Practical Data Science using Python

22 Lectures 6 hours

## Description

Python number method round() returns x rounded to n digits from the decimal point.

## Syntax

Following is the syntax for round() method −

```round( x [, n]  )
```

## Parameters

• x − This is a numeric expression.

• n − This is also a numeric expression.

## Return Value

This method returns x rounded to n digits from the decimal point.

## Example

The following example shows the usage of round() method.

```#!/usr/bin/python

print "round(80.23456, 2) : ", round(80.23456, 2)
print "round(100.000056, 3) : ", round(100.000056, 3)
print "round(-100.000056, 3) : ", round(-100.000056, 3)
```

When we run above program, it produces following result −

```round(80.23456, 2) :  80.23
round(100.000056, 3) :  100.0
round(-100.000056, 3) :  -100.0
```
python_numbers.htm