MENU
Question -

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

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
Any questions? Ask us!
×