0% found this document useful (0 votes)
7 views2 pages

Python Series Sum Programs

Uploaded by

palir67298
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Python Series Sum Programs

Uploaded by

palir67298
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1) Program to print sum of Series (2^2+4^3+6^4......

n)

s=0
b=2
p=2
n=int(input(“Enter no. of Terms”))
for i in range(1,n+1,1):
t=b**p
s=s+t
b=b+2
p=p+1
print(s

2) Program to print sum of Series (3^2+5^3+7^4......n)


p=2
s=0
b=3
n=int(input(“Enter no. of Terms”))
for i in range(1,n+1,1):
t=b**p
s=s+t
b=b+2
p=p+1

print(s)
3) Program to print sum of Series 1/!1 + 1/!2 + 1/!3 +1/!4 +n

num=int(input(“enter no”))
t=0
fact = 1
s=0
for i in range(1, num+1):
fact *= i
t= (i/ fact)
s=s+t
print(s)

4) Program to print sum of Series 1/1 - 1/2 + 1/3 -1/4 +n

p=2
s=0
n=int(input(“Enter no. of Terms”))
for i in range(1,n+1,1):
if i%2 = =0:
t=(1**i)*(-1)
s=s+t
else:
t=(1**i)
s=s+t
print(s)

You might also like