所以我的代码使用Python和的一个系列
def formula(n):
while(n < 11):
answera = 15/(-4)** n
print(answera)
n = n + 1
formula(1)
我怎样才能在居高临下的顺序添加输出?
例如,
first_output = (the output of n = 1)
second_output = (the output of n = 1) + (the output of n = 2)
third_output = (the output of n = 1) + (the output of n = 2) + (the output of n = 3)
等..
n输出=输出当n +(N-1)个输出 –
你关心中间输出吗?也就是说,如果你看到“公式(1)”和“公式(2)”是什么样子,你是否在意?并且要清楚:你想采用'公式'并将其应用于输入列表,如1,2,3 ...,对吗? – Makoto
你的功能不清楚。对于'n = 1',结果应该是10次'15 /( - 4)** n' 10次不同'n'值的总和吗?或'公式(n)'应该返回'15 /( - 4)** n'? – ozgur