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 measure of angle A? Enter your answer as a decimal in the box. Round only your final answer to the nearest hundredth.
Find the volume of each cylinder. Round your answers to the nearest tenth if necessary. Use 3.14
Which best describes the main sources of energy in the United States
Which of these is NOT one of the themes presented in The Great Gatsby? Question 19 options: Degradation of society The American Dream truth vs. superficiality f
Jessica recently moved to an apartment in the industrial area of Readington City. She noticed that the roads in her neighborhood warm up quickly. She also notic
The test most commonly used to confirm HIV infection
A counterexample for the expression sin y tan y= cos y is 0.
Please help. I would really appreciate it.
what services did settlement houses provide
there are many amendment to the constitution. how many were included in the bill of rights