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

EASY SCALE FACTOR SHOW WORK
can someone help me solve this and show me the work? it says solve and graph the compound inequality -8<2x+4<10
the reproductive system of a male mammal provides
What are some methods used by Mussolini to rise to power?
Why is California warm and moderately humid but Nevada is hot and dry? A. The two states are at different latitudes. B. As air moves west over California's mo
where are the three parts of an atom located
an explanation describe if a green pet mates with an orange pet, can they have any orange offspring.
a woman lifts a 300 newton child a distance of 1.5 meters in 0.75 seconds. What is her power output in lifting the child?
which point is in the solution set to the system of inequalities: y>2x-1 and y<1/2x+5
What are the factors of 6x + 24?