Python / vs // operator

Python / vs // operator

In Python 3.0 and above, check in your terminal

a) / operator aka classic division

>>> 5/2
2.5

b) //operator aka floor division

>>> 5//2
2

Reference

9.9. operator — Standard operators as functions

Python / vs // operator

Leave a Reply

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