1,文件中存在中文(python2.x)
首行加入注释
# -*- coding: utf-8 -*-
2,python2.x中是区分float 与 int 。
result = 8 / 10
print(result)
# 结果=0
result = 8.0 / 10
print(result)
# 结果=0.8
1,文件中存在中文(python2.x)
首行加入注释
# -*- coding: utf-8 -*-
2,python2.x中是区分float 与 int 。
result = 8 / 10
print(result)
# 结果=0
result = 8.0 / 10
print(result)
# 结果=0.8