Skip to content

31. What is the use of // operator in Python?

Python provides // operator to perform floor division of a number by another. The result of // operator is a whole number (without decimal part) quotient that we get by dividing left number with right number. It can also be used floordiv(a,b).

E.g. 10// 4 = 2 -10//4 = -3