这个代码在python 2.7上能用,在python 3.7上 n = n + 1报错,有那哪位能告诉我问题处在 哪里?谢谢
L = [75,98,59,81,66,43,69,85]
sum = 0.0
n = 0
for x in L:
sum = sum + x
n = n + 1
print (sum / n)
L = [75,98,59,81,66,43,69,85]
sum = 0.0
n = 0
for x in L:
sum = sum + x
n = n + 1
print (sum / n)
2018-07-19
举报