In Python 2, division of two ints produces an int. In Python 3, it produces a float. We can get the new behaviour by importing from __future__
.
>>> from __future__ import division
>>> a = 4
>>> b = 6
>>> c = a / b
>>> c
0.66666666666666663
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…