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 3 2/5 as a improper fraction
Lea wants to put a fence around her garden .Her garden measures 14 feet by 15 feet .She has 50 feet of fencing .How many more feet of fencing does Lea need to p
Which was a result of Europe’s settlement of North America?
Does every point lie in a quadrant?explain
Which of the following distinguishes a secondary source from a primary source? A secondary source is much more difficult to find. A secondary source has the ben
There are two types of intaglio printing, etching and engraving. What is the primary difference between the two?
Which statement does not describe conditions that led to the War of 1812? A.England still had forts in territories west of the Appalachians B. British sea capta
a sum of money was shared among Daniel Elliot and frank in the ratio 5:7:8 if franks share was $2,781 more than Daniels share what was the original sum of money
Which shows 7 2/9 written as an improper fraction? 65/9, 79/2, 72/9 or 23/9?
How many Ukrainians died in world war 1?