How to use floor in Python

2 Answers

0 votes
import math

f1, f2, f3, f4 = 1.1, 1.5, 1.6, 1.9

print(math.floor(f1))
print(math.floor(f2))
print(math.floor(f3))
print(math.floor(f4))




'''
run:

1
1
1
1

'''

 



answered Jun 9, 2022 by avibootz
0 votes
import math

f1, f2, f3, f4 = -1.1, -1.5, -1.6, -1.9

print(math.floor(f1))
print(math.floor(f2))
print(math.floor(f3))
print(math.floor(f4))




'''
run:

-2
-2
-2
-2

'''

 



answered Jun 9, 2022 by avibootz

Related questions

1 answer 106 views
2 answers 203 views
1 answer 191 views
1 answer 162 views
162 views asked May 30, 2019 by avibootz
1 answer 119 views
...