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

how do i find the area
The radius of a circle is 4 yards what is the circles area
What's the solution to the equation 6-(2/3)m=5
Read the excerpt from "The Tell-Tale Heart.” Now this is the point. You fancy me mad. Madmen know nothing. But you should have seen me. You should have seen how
The answer to the problem 3(6 - 7) + 8 is called a ____
Need a solver Explanation too
What motivates friar to him romeo and juliet to defy their parents?
Which type of language is used in the sentence below? The artist uses bright colors and broad brush strokes to evoke a sense of jubilance and joy.
What finally led to U.S participation in World War I? A- requests for support from England and France B- the addition of Mexico to the Allies C- unrestricted Ge
Why did Demosthens want the Greek city states to do about the Macedonians