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

What line of events led to the annexation of hawaii?
Find the value of the expression. pm + 4 for m = 4 and p = 4
Babies in an iranian orphanage suffered delayed intellectual development due to question 43 options: telegraphic speech. stereotype threat. a deprived environme
The width of a rectangular is 7 meters greater than its length. If the area of the rectangle is 170 square meters, write the quadratic equation in standard form
What does doubling the money supply do to inflation?
What with the political monopoly, the Cheka and the Red Army, all that now existed of the “Commune-State” of our dreams was a theoretical myth. –Victor Serge, M
Make a list of at least 10 steps that a medical facility can take to ensure that there is a solid contingency plan in place. Refer back to the activity on Conti
What is the best reason for selecting a quality friendship?
Given that a­­b = x, evaluate the following 2a^3b+a^2b+a^b
Most substances _______ in temperature and _______ when heat is added to them. A. increase; contract B. increase; expand C. decrease; contract D. de