python2中除法总为0 原因:python2默认整形int的除法自动取整,比如 0.01取整为0. 解决方法: a=1 b=10000 print a/b #转为浮点数 print float(a)/b