求大神解释,谢谢
# -*- coding: UTF-8 -*-
def square_of_sum_list(L):
for x in L:
x=x*x
return sum(L)
print square_of_sum_list([1, 2, 3, 4, 5])
运行发现这个问题:
C:\LearnPython>python 7-3.py
File "7-3.py", line 3
for x in l锛?
^
SyntaxError: invalid syntax
求解释,谢谢
# -*- coding: UTF-8 -*-
def square_of_sum_list(L):
for x in L:
x=x*x
return sum(L)
print square_of_sum_list([1, 2, 3, 4, 5])
运行发现这个问题:
C:\LearnPython>python 7-3.py
File "7-3.py", line 3
for x in l锛?
^
SyntaxError: invalid syntax
求解释,谢谢
2017-05-22
举报