Answer to Question #290968 in Python for Sss

Question #290968

Write a python program with algorithm/flowchart to find sum of the following series for n terms: 1 – 1/2 + 1/3.....+1/n × (-1)^(n-1).


1
Expert's answer
2022-01-26T15:28:20-0500
n=int(input('Input n: '))
sum=0
for i in range(1, n+1):
    sum+=(-1)**(i-1)*1/i
print(sum)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS