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

Describe the characteristics and classification of seed plants, including cone-bearing plants and flowering plants
José is making fruit-filled tart shells for a party. He has 180 raspberries and 72 blueberries. The tarts will each have the same number of berries. Raspberries
Describe two physical properties of sodium which are different from the physical properties of transition elements such as copper.​
how many tenths in one penny ​
may you defeat your rivals! into passive voice​
Use deductive reasoning to tell whether each statement is true or false. If it isfalse, give a counterexample.22. For all real numbers a and b, a - b = -b + a.2
in a polynomial expression, a term can be​
What was the primary cause of the famine in Ethiopia between 1984 and 1985? civil war O global boycott severe drought government corruption
An ideology that encourages a nation to "mind their own business" is (Choose one) : a) transnational b) interventionist c) isolationist d) supranational
You're considering a project with an initial cost of $6400, what is the payback period for this project if the cash inflows are $900, $1350,$2800, $1350 & $