From the course: Python Functions for Data Science
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Python round() function - Python Tutorial
From the course: Python Functions for Data Science
Python round() function
- [Instructor] Round is another useful built-in Python function that facilitates computational work. The round function takes in a numerical value as the required input. This function can also take in an integer as an optional second input that specifies the number of digits after the decimal point to round to and the rounded value of the first input is returned. If the second input is omitted or a zero, the function rounds the given numerical value to the nearest integer. If the second input is provided, the function rounds the given numerical value to the specified number of digits after the decimal point. In other words, if the second input is provided, the function rounds the given numerical value to the closest multiple of 10 to the power of negative N, with N being the second input. If the given numerical value is equally close to two multiples, the function rounds it to the even multiple. I'll be walking through…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.