write a python program to print the sum of the following series
1-x+x²-x³+x⁴-x⁵.....x^n
❌DO NOT SPAM❌
[[∆correct answers get a follow and 10 thanks∆]]
Answers
Answered by
7
Question:-
Write a python program to print the sum of the series
1-x+x²-x³+x⁴.....xⁿ
Program:-
n=int(input("Enter the value of n: "))
x=float(input("Enter the value of x: "))
s=0
for i in range(0,n):
if (i%2==0):
s=s+x**i
else:
s=s-x**i
print("Sum of the series is: ",s)
Answered by
3
Answer:
write a python program to print the sum of the following series
Similar questions