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

Helpppp asapppppp....
Find the value of annuity if the periodic deposit is $250 at 5% compounded quarterly for 10 years
PLEASE help me with this question! This is urgent!
How did political events impact young people, and how did the youth culture impact the politics of the period? What caused the rise of student radicalism in the
What is immigration? What is interested about immigration? What to know about immigration?
Show that (a - b)+(b-c)+(c -a)3 = 3 (a - b) (b -c) (c-a)​
9. A college financial advisor wants to estimate the mean cost of textbooks per quarter for students at the college. For the estimate to be useful, it should ha
Define the term “Tyndall effect”. Which of the following would show Tyndall effect:- (Starch solution, sodium chloride solution, alcohol and water mixture)
how did Aurangzeb occupy the throne​
Read and match the sentences or expressions that make the MOST sense together