Welcome to Westonci.ca, where you can find answers to all your questions from a community of experienced professionals. Explore thousands of questions and answers from a knowledgeable community of experts on our user-friendly platform. Get immediate and reliable solutions to your questions from a community of experienced professionals 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.