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

I NEED HELP ASAP PLEASE!!! EXPLAIN TOO
Which of the following situations is most likely to provoke indignation?
Inventory Heung-Soo is responsible for checking a shipment of technology equipment that contains laser printers that cost $700 each and color monitors that cost
What conclusions did you draw as you evaluated this text? What helped you reach your conclusions? i don't know what to do
Animals such as jellyfish and octopuses shoot water to propel them- selves. What do their muscles act on?
***economics***Examine this supply and demand graph for a product. What does the red dot on the graph represent?A. The product's supply scheduleB. The product's
Inhalation is the most common way for a(n) to enter the body. electrical current Information Chemical Water
A human baby weighs 7 lbs and 8 oz. at birth. After one month, she weighs 10 lbs and 3 oz. How much more does she weigh one month after birth?
Sometimes even the most careful food preparation can lead to tragedy. For many generations, humans have made sausages, but on occasion the sausages have become
i really need someones help ):