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).
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?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment