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 significance of proctor plowing on sunday?
What type of sentence is this: Richard gave me one of his extra-rotten, weasel-eyed,greeny-toothed grins. Is it simple, compound or complex? And does it contain
Which subjects did knossos palace frescoes depict? (select all that apply) a. nobels in gardening b. king's hunting c. warriors in battles d. bulls leaping
A projectile is fired straight up with a positive velocity of 100 m/s when the projectile returns
which of the following shows the correct steps to find the value of 8 1/3
What was the major goal of the Sons of Liberty? To terrorize the stamp collectors To show opposition to British economic actions To organize an independence mov
Describe a typical November 2nd day in Mexico
Arnold is trying to understand the disagreement that occurs between Mr. and Mrs. Van Daan with regards the Mrs. Van Daan's fur coat. Which identifies the most u
5.97x10-^24-7.34x10^22 Show all work please
What part of the brain controls language understanding?