A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_func_round.asp below:

Website Navigation


Python round() Function

Python round() Function

❮ Built-in Functions

Example

Round a number to only two decimals:

x = round(5.76543, 2)
print(x)

Try it Yourself » Definition and Usage

The round() function returns a floating point number that is a rounded version of the specified number, with the specified number of decimals.

The default number of decimals is 0, meaning that the function will return the nearest integer.

Syntax Parameter Values Parameter Description number Required. The number to be rounded digits Optional. The number of decimals to use when rounding the number. Default is 0 More Examples

❮ Built-in Functions

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4