所以我的代碼使用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