0
What is the difference between / and //?
3 Respostas
+ 6
5/2 = 2.5
5//2 = 2
+ 6
stackoverflow.com/questions/183853/what-is-the-difference-between-and-when-used-for-division
+ 4
Just adding some words to the sample of Arsenic:
5/2 = 2.5 -> this is a regular division. All divisions with this operator is giving a float number as result.
5//2 = 2 -> this is called a floor division. Only the whole number part is used here, the fractional part is ignored. the result is always an integer number.