+

math.floor in Python

Rounds down.

math.floor (x)

-> int / float

x - Number to be rounded. 


Returns the largest integer (up to + py3.0 as floating point numbers ) less than or equal to x .

Note

+ py3.0 If x is not a floating point number, the function delegates execution to the object .__ floor __ () method implemented in x .



  from math import floor 


floor (1) # 1
floor ( 1.1) # 1

floor (-1) # -1
floor (-1.1) # -2

Get Solution for free from DataCamp guru