Loading... > Python 3.x Python中有两种除法以及一种取余操作。取余对于有一定的编程基础的人来说,相对很好理解,下面简单举例,然后开始讨论两种除法。 <!--more--> ```python >>>15 % 10 5 >>>6%4 2 >>>9%5 4 ``` - ## `/`真除法: ```python >>> 3/2 1.5 >>> 3/2.0 1.5 >>> 6/2 3.0 >>> 6/2.0 3.0 ``` - ## `//`地板除法: ``` >>> 3//2 1 >>> 3//2.0 1.0 >>> 6//2 3 >>> 6//2.0 3.0 ``` Last modification:September 11, 2018 © Allow specification reprint Like 0 If you think my article is useful to you, please feel free to appreciate