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

The numbers 4 through 14 are placed in a bowl and drawn at random then replaced after being drawn.What is the probability that you will choose an even number
Which ion combines with ba2 to form a compound that is most soluble in water
If a company saw an online photo of you playing basketball, it might try to sell you: A. music CDs. B. pet food. C. high-top sneakers. O D. a baseball mitt. ВМІ
(-0.39) (0.06) (-0.29)
What is the meaning of 'craigslist' in English? What is it used for?
Help find the errors in the Spanish sentence.
Briefly explain the two ways Avogadro's number was calculated.​
Help please extra points
Which of the following questions would help you to analyze your​ audience? A. What do my readers need from my​ writing? B. How will I know if my writing has a
Writing Prompt You have just read two passages about students who developed science research projects. Write an informational essay that explains the various re