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

Read the full book at www.amazon.com
Posted in Python, Python Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*