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 rmstl stand for just make something up, it’s supposed to be funny
How do you say "I HATE MYSELF" in French
I need help with this one please​
Determine if the figures below are similar. If they are, identify the similarity statement.
In a certain arithmetic sequence, the 10th term is equal to 56 and the 12th term is equal to 108. What must the 11th term be?
Why would the life of somebody be dramatize in a play
Identify the correct sentece OA. I read the 'New York Times' and the Washington Post online almost every day b. I read New York Times and the Washington Post o
what is 1/4 less than -3/4
PLZ HELP HURRY PLZZZZZZ WHOEVER GETS IT GETS 30 POINTS
Which of the following documents is best matched to the main idea it supports?