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

Which is the smaller integer : -29 or -10 ?
Where is Miep on the day the Secret Annex is raided? She is visiting family in the country. She has already been arrested by the Nazis. She is searching for foo
please help me with this !!!!!!!!!!
what is 5% simple interest for one year on $575?
Use the graph to fill in the blank with the correct number. f(−2) = ________ X, Y graph. Plotted points negative 3, 0, negative 2, 2, 0, 1, and 1, negative 2.
Read the clinical scenario, and then answer the questions that follow to become familiar with the traditional NCLEX question format. Ms. Hungh, a Burmese immigr
Tickets to a play cost $12.75 per ticket plus a $12.00 fee per order online. At the box office the cost is $15.75 per ticket.
Consider a small frictionless puck perched at the top of a xed sphere of radius R. If the puck is given a tiny nudge so that it begins to slide down, through wh
What value of x will satisfy the equation:cos( x) = sin( 2x+ 57 )
What is an electrocardiogram