假如x是列表类型,可以这样写:
l = [i*x[i] for i in range(1, len(x))+1] #求出所有 i*x[i] print(sum(l)) #求和
可以,x是什么
for i in range(10): 然后填入你的公式。然后创建一个变量,用来累加