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

Michael works in a supper market.he is paid 10.80 per hour .what is Michels overt time pay rate
4. Making Inferences: Where on the map would the ancient civilizations of Egypt and Mesopotamia have been likely to begin? Why?
Sooo my math teacher who’s a pain in the behind was the only one gave us homework while we’re out for and extended 1 day so if you would please help me bc I hav
-3x^2+6x=0. Find the value of x.
Which of the following is NOT true about the battles of Lexington and Concord? Select one: a. The militia ambushed the British in Concord. b. The British found
Are These Correct ? HELPP
which is the correct order of the geologic time scale from oldest to recent
which of the following statement is true ?a)the word population is evenly distributedb) Natural resources of the word are equally distributedc) world population
-(-2) ...................................................
Doug offers to sell a computer router to Eve, but it is stolen before Eve accepts. Doug: a. is not required to obtain a similar item for Eve, because it could t