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

Can someone help me please
The graphs below have the same shapes. What is the equation for the red graph?
15. Read the lines of verse. For thy sweet love remembered such wealth brings That then I scorn to change my state with kings. In Sonnet 29 by William Shakespea
which types of media mostly follow journalism standards
what is scary in English ​
what is the logarthic form ​
what is scary in English ​
A man walks 4km from point x due east of point Y. The bearing of a flag point x and y are due N80°W and N40°E respectively. Find the distance of the flag pole f
On a separate piece of graph paper, graph y = Ixl - 1; then click on the graph until the correct one appears.
A. 0 m/s B. -0.17 m/s C. 12 m/s D. 0.17 m/s