码迷,mamicode.com
首页 > 编程语言 > 详细

What is the reason for having '//' in Python?

时间:2017-04-11 09:42:11      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:reason   floating   add   tin   was   ati   with   python   integer   

In Python 3, they made the / operator do a floating-point division, and added the // operator to do integer division (i.e. quotient without remainder); whereas in Python 2, the / operator was simply integer division, unless one of the operands was already a floating point number.

What is the reason for having '//' in Python?

标签:reason   floating   add   tin   was   ati   with   python   integer   

原文地址:http://www.cnblogs.com/casperwin/p/6691843.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!