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

Scientific laws explain how and why something occurs on a scientific level.
Cystourethroplasty with bilateral ureteroneocystostomy. The CPT code for this procedure is _____.
Questions 1 to 48, what are the answers? Thank you (this is a tense test)
ASAP!!! PLEASE help me with this question! It is urgent...
Why is it important for an ecosystem to be in balance? Why? ....... please help me.
what is [tex] \frac{2ax + 3}{ax + 3} = - 1[/tex]x value​
Identify how many distinct classes there were in Rome
What does the pH of a solution have to be in order to be a base?
A study finds that there is a positive correlation between height and math test scores. The researcher concludes that taller people are better at math. However,
How many molecules are in 12.5g of water (H2O)? Molar mass Help asap