At Westonci.ca, we provide clear, reliable answers to all your questions. Join our vibrant community and get the solutions you need. Get quick and reliable solutions to your questions from knowledgeable professionals on our comprehensive Q&A platform. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

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.