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 fractional equivalent of 0.2323
A woman who quits smoking tobacco is affecting her health in what way
In baseball batting averages are expressed as decimal numbers if the player has had 8 hits out of 20 a bats what is his batting average and what percentage of t
In the last two weeks of a sale prices are reduced first by 30% and by a further 40% of the new price what is the final sale price of a shirt which originally
Large companies such as Walmart, IBM, and Ford are classified as A. S-corporations. B. C-corporations. C. limited liability companies (LLCs).
At a hardware store, each wooden plank costs $3.57. How much do 12 planks cost?
Help please I’m begging u !!!! I need to finish my hours by 2 please ! Tm is the last day !!!
The term novel can be defined as a fictional prose narrative of considerable length, typically having a plot that is unfolded by the actions, speech, and though
Which of the following equation describe the line shown below
Trying to find ACB Thankssss