round() — Easy Examples
Rounds a number to a given number of decimal places
Basic round() usage
Simple demonstration of the round() built-in function.
python
print(round(3.14159, 2)) print(round(2.5)) print(round(3.5))
round() is a built-in function that rounds a number to a given number of decimal places.
round() with different inputs
Calling round() with various argument types.
python
# More round() examples print("round() is a Python built-in function") print(f"Type: {type(round)}")
round() accepts different types of arguments and produces corresponding results.
Want to try these examples interactively?
Open Easy Playground