-1

why does one give a different end result than the other in python. When I type in print(25/10) the result is 2.5. Yet when I type print(25//10) it is 2. Could anyone tell me why?

Jonny
  • 11
  • They are different operators. / is division, // is 'floor division'. It's worth mentioning that you must be using python 3, in python 2 all standard division was a floor division – mephisto Nov 18 '14 at 17:12
  • See https://docs.python.org/3/whatsnew/2.2.html#pep-238-changing-the-division-operator for more info – mtrw Nov 18 '14 at 17:14

1 Answers1

0

// used for Floor Division - The division of operands where the result is the quotient in which the digits after the decimal point are removed.

kriyeta
  • 695
  • 4
  • 12