为什么一直都是错误,求解答
>>> L=[1,2,3,4,5]
>>> sum=0.0
>>> for x in L:
... sum=sum+x
... print(sum/5)
File "<stdin>", line 3
print(sum/5)
^
SyntaxError: invalid syntax
>>>
>>> L=[1,2,3,4,5]
>>> sum=0.0
>>> for x in L:
... sum=sum+x
... print(sum/5)
File "<stdin>", line 3
print(sum/5)
^
SyntaxError: invalid syntax
>>>
2023-04-27
举报