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

How did different group of Americans help america win world war 1?
What was the Los Angeles chamber of commerce
I need this right away! (20 points!!!)
Last year, a soft drink manufacturer had 21% of the market. In order to increase their portion of the market, the manufacturer has introduced a new flavor in th
A photo printing website sells 8x 10 prints for $4.99 and 3 X 5 prints for $1.99 write an expression to represent the total amount the website can earn selling
The amount you owe in state income tax is based on:
If the amount of people contributes to the amount of GDP a country has what causes the amount that is used to turn against ones country??
Find the volume of a cylinder with a radius of 6 cm and height 15 cm? (to the nearest whole centimeter)
____________ cells are simple and do not have a nucleus or membrane bound organelles.; ____________ cells are more complex and do have a nucleus and membrane bo
Yo saco la basura ________ por la semana: los lunes, los jueves y los sábados. a. nunca b. dos veces c. tres veces d. una vez