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

identify one question from pages 45-48 that best shows the perspective of napoleon ​
HELP PLEASE WILL MARK BRAINLIEST!!
A reaction that proceeds more slowly than another reaction has a (2 words) ______________
Which of these BEST sums up the overall goal of the Cultural Revolution in China? A) drive out British merchants who continued to trade opium B) to take back t
what best describes transformation in bacteria
3.5 x 10^3 divided by 7 x 10^-2
Simplify (5x2 + 3x + 4) + (5x2 + 5x − 1). 10x2 + 8x + 5 25x2 + 8x + 3 10x2 + 8x + 3 10x2 + 8x − 3
Can it ever be unhealthy for someone to feel “lucky" to be with someone else that they feel is "out of their league"?
2) Namc one feature of sewa.
What is the area of the following circle? Either enter an exact answer in terms of or use 3.14 for 1 and enter your answer as a decimal. d = 8