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 principal will earn the interest rs.750 in 3 year at the rate of 10% per year .​
Gavin charges $20 per hour to fix your computer. It costs him $3 for gas for each job.​
Do someone have a courses hero account
Lydia recorded the grade-level and instrument of everyone in the middle school School of Rock below. Seventh Grade Students Instrument # of Students Guitar 7 Ba
Decrease 20 by 1/4 how do You do it
What is the molar concentration of a 32.5 wt% sucrose solution? The density of the solution is 1.139 g/mL.
solve for n: 2 + 4tan(1 - n) = 1
plz help me i will give brainliest plz help
Why do you think photosynthesis doesn't happen in other parts of the plant?​
100 points + brainliest:3​