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

does anyone know the answers to these blank questions? if so pls type it in! thank you!! ( pic question uploaded )
Measuring the height of a tree is usually more difficult than measuring the diameter of the tree. Therefore, many researchers use regression models to predict t
Of the following three Greek philosophers, who lived the longest?why?Aristotle: born in Stagira in 384 BCE, died in 322 BCE.Pythagoras: born in Samos around 580
Reread lines 1-11 and state a conclusion about what Torres is planning to do. What evidence led you to this conclusion?
HELP PLEASE determine the number of real number solutions for the equation x^2+6x+9=0​
Why were railroads an important part of the western economy in the mid-19th century?
Helium is a gas lighter than air that is used in balloons. The density of helium is approximately 0.14 kilograms per cubic meter. You get 5 helium balloons for
Naomi is planning to get a job after graduating from college. Which explains why she should establish a positive credit history? She will appear more responsibl
Solve 2x+4<6 I have no clue
The perimeter of a rectangle is 54 feet. The area of the rectangle is 176 square feet. Find the dimensions of the rectangle.