2009年5月4日 星期一

Do integer division and get integer result use //

a=8
b=5
print(type(8/5),8/5)
print(type(8//5),8/5)
print(type(8.0/5),(8.0/5))

結果
(type 'int', 1)
(type 'int', 1)
(type 'float', 1.6000000000000001)

沒有留言:

張貼留言