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

REALLY EASY!!! JUST CAN'T CHOOSE !!!! WILL GIVE BRAINLIEST!!!! AT LEAST TAKE A LOOK!!! ANSWER IF 100% SURE THO!!! 4. In what way was Henry David Thoreau's outlo
Which of the five senses does the quote appeal to? “In this place of darkness and malediction we can but stand in awe and remember its stateless, faceless and n
What organ picks up waste products from the blood?​
Read this excerpt from Kennedy's address to the nation on June 11, 1963, and answer the question. We are confronted primarily with a moral issue. It is as old a
1) Miguel sells a house for $275,000. His commission for the sale is $6,875. What percent commission did he earn? (Make sure to write your answer as a percent f
Keri deposits $100 in an account every year on the same day. She makes no other deposits or withdrawals. The account earns an annual rate of 4% compounded annua
Which takes up a larger area: the flowers or the grass?
What is Romeo's dominant humor?
PLZZZZZZZZZZZZ HELPPPPPPPPPPPPPPPPPPPPP MEEEEEEEEEE Which sentence below shows the correct use of a gerund? A. Conducting scientific experiments can be both fu
how to write 70 persent as fraction