+ 2
What is the difference between floor division operator and normal division operator?
3 ответов
+ 10
normal division
5/2 =>2.5
floor division
5//2=>2
+ 4
Normal division is basically... normal division. For example:
print (31/4)
#7.75
But floor division rounds down the answer to the nearest integer. For example,
print(31//4)
#7 (you throw away everything after the decimal point).
Hope this helped. 😉
+ 1
Also, always gives a float for normal division. For example:
10/2 => 5.0
10//2 => 5