round()
noun
say it: “ROWND” /ˈraʊnd/
A built-in Python function that rounds a number to the nearest whole number, or to as many decimal places as you ask for.
What does round() do?
round() rounds a number to the nearest whole number, or to as many decimal places as you ask for.
print(round(4.6)) # 5
print(round(19.9876, 2)) # 19.99
In a sentence
- “round() turned 19.9876 into 19.99 for the price label.”
- “The average grade was shown with round() to one decimal place.”
Level: Novice · More Python terms at this level
Updated