At Westonci.ca, we make it easy for you to get the answers you need from a community of knowledgeable individuals. Connect with a community of experts ready to provide precise solutions to your questions on our user-friendly Q&A platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

Write a program to find the sum of given series: (a) S = 1 + (1/2) + (1/3) + ...... + (1/20)

Sagot :

total = 0

numerator = 1

denominator = 1

while denominator != 20:

   total += numerator/denominator

   denominator+=1

print(total)

I wrote my code in python 3.8. I hope this helps.