1.

Write a Python script to find sum of the series :s = 1 + x + x2 + x3 + …. + xn

Answer»

x = float (raw_input (“Enter value of x :”)

n = int (raw_input (“Enter value of n :”))

s = 0

for a in range (n + 1) :

s + = x**a

print “Sum of series”, s



Discussion

No Comment Found