Python2 中除法默認向下取整,因此 1/2 = 0,爲整型。
For (plain or long) integer division, the result is an integer. The result is always rounded towards minus infinity: 1/2 is 0, (-1)/2 is -1, 1/(-2) is -1, and (-1)/(-2) is 0.
而 Python3 中的除法爲正常除法,會保留小數位,因此 1/2 = 0.5,爲浮點型。