👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.

What is the difference between '/' and '//' when used for division?

In Python 3.x, there are two operators for the division :

  •  5 / 2 returns 2.5 (floating point division)
  • 5 // 2  returns 2 (floor or integer division)


Note that -5 // 2 returns -3.

More