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

The second number in an ordered pie of numbers that corresponds to a point on a coordinate system is the
cope of Research the brief history linked to the day of Heritage Day ​
Please help meeee!!!!!!!!
Please help I’ll give brainey if right answers
I don't like doing math help if you know :)
What is 6 fewer than 3 times a number
Are the Wakandans wrong to distance themselves from the struggles of black people in Africa and around the globe? Why or why not? Be specific. (Black panther m
How to play tennis is a topic that would be considered too narrow too broad
Matthew can walk on his hands. He does not remember how he learned to do it, and he cannot explain to others how he does it. Matthew’s skill of walking on his h
What is the author's main argument in "The Damation of a Canyon"? A. Plant life and wildlife in the Glen Canyon area will someday be allowed to grow and flouris