标签:ase error cal style invalid pytho 报错 oat int()
for i in column1:
x = int(i)
s += x
print "sum:",s,"count:",len(column1)
# round (s / len(column1), 3)
print "avg",round (s / len(column1), 3)
Traceback (most recent call last):
File "C:/3/csv测试.py", line 26, in <module>
x = int(i)
ValueError: invalid literal for int() with base 10: ‘18.4‘
这里的错误在于用了int 应该用float
python 小数相加报错 invalid literal for int() with base 10
标签:ase error cal style invalid pytho 报错 oat int()
原文地址:http://www.cnblogs.com/hanxing/p/6906334.html