SO Я написал этот фрагмент, но он не работает.Loop (1 + x + x ** 2 + x ** 3 + x ** 4 .... n) не работает
x=1
sum1=0
n=int(input("enter how long the series should be"))
print (x)
for a in range (1,n):
sum1=sum1+(sum1**a)
print(sum1)
a=a+1
print("the sum of the series is",sum1)
Выход был:
enter how long the series should be5
1
0
0
0
0
the sum of the series is 0
>>>
Вам не нужно увеличивать 'a' –
Вы не хотите' х ** Ā'? – jtbandes
Спасибо всем. –