s = ' python was strated in 1989 by "guido".\npython is freeand easy to leaen'
print s
print s
2017-03-12
def square_of_sum(L):
sum=0
for x in L:
x = x*x
sum += x
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
sum=0
for x in L:
x = x*x
sum += x
return sum
print square_of_sum([1, 2, 3, 4, 5])
print square_of_sum([-5, 0, 5, 15, 25])
2017-03-12
已采纳回答 / qq_醉饮千觞不知愁_0
def square_of_sum(L): sum = 0 for v in L: sum += (v * v) return sumprint square_of_sum([1, 2, 3, 4, 5])print square_of_sum([-5, 0, 5, 15, 25])
2017-03-12
最赞回答 / Hagrid_Chuh
在调用函数的时候你使用了print(sayhello()),这里首先运行函数sayhello(),运行结果输出一个Hello world 并且返回值为None,所以print(sayhello())就相当于print(None)直接用sayhello()即可
2017-03-12
已采纳回答 / NLPZCY2017
def square_of_sum(L): return sum([i * i for i in L])print square_of_sum([1, 2, 3, 4, 5])print square_of_sum([-5, 0, 5, 15, 25])
2017-03-12