Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

As the title suggests, I want to take a floating-point number and round it down to the nearest integer. However, if it's not a whole, I ALWAYS want to round down the variable, regardless of how close it is to the next integer up. Is there a way to do this?

1 Answer

0 votes
by (106k points)

For round a floating-point number down to the nearest integer you can use the below-mentioned way:-

print(int(x))

Browse Categories

...