lindajones2268 lindajones2268
  • 02-01-2021
  • Computers and Technology
contestada

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

Respuesta :

Cytokine
Cytokine Cytokine
  • 02-01-2021

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.

Answer Link

Otras preguntas

What is the meaning of an eye for an eye makes the whole world blind?
Please help. I am stuck on this algebra question: A homeowner wants to increase the size of his deck that now measures 15 feet by 18 feet. His homeowner's assoc
What are basic physical quantities and it's measurement units? Make a chart.
Kimberlee feels distressed when she sees poverty. to reduce her own feeling of distress, she works tirelessly in a homeless shelter to help those who are not as
What obstacles did the English settlers in the Chesapeake overcome?
The remains of what appear to be the oldest stone temples have been discovered in ____.
The area of the irregular polygon is ____ square units.
The ________ is drawn from selected subgroups of a target population.
Name four ways the environment contributes to economies
The phosphate functional group in the non cyclic adenosine monophosphate molecule contains "acidic hydrogens".Explain what this phrase means.