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 does Buck often dream of as he sleeps by the campfire? A. John Thornton B. Judge Miller's home C. His fight with Spitz D. Primitive man
What type of phrase is underlined in the sentence below? Have you been to the new Thai restaurant that opened last month? Question 6 options: participial ph
-1/3d=12 can you help me find d?
Simone has 5 employees in her flower shop. Each employee works  6 4/15 hours per day. How many hours, in total, do the 5 employees work per day?
What happened to Chinese scholars during the Mongol rule? Please answer if you know it.
I also want to go to Mexico and I am saving for the trip. Identity the sentence that uses commas correctly.
Which words are an example of a slant rhyme? A. pilot and lieth B. thou and know C. tide and ride D. mask and mile
All of the following are examples of minerals except __________. a. diamonds b. bauxite c. iron d. timber
"A sweater that costs $20 was marked up by 60%. what was the markup and what is now the selling price?" for the markup I got 12 and for the selling price I got
What two ways helpful bacteria work to keep you healthy