We can find out the largest integer smaller than or equal to a given number using math.floor().
Syntax:
math.floor()
Example:
print(math.floor(0.5)) ---> 0
print(math.floor(-0.5)) ---> -1
Syntax:
math.floor()
Example:
print(math.floor(0.5)) ---> 0
print(math.floor(-0.5)) ---> -1
No comments:
Post a Comment