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 amount of vinegar that melody used for a recipe can be written as a whole number. Which could be the amount of vinegar that melody used? A.-3.75 tsp B.1.5 t
what does the rotation of the Earth cause?
Which African leader of Mali came to power in 1307, was a devout Muslim, and was known for making a hajj to Mecca? Ezana Ewuare Mutota Mansa Musa
What characterizes an elastic collision, but not an inelastic collision, in a closed system? A. Momentum is conserved B. Total energy is conserved C. Kinetic e
A primary reason the mongols and the british were able to expand their empires through conquest was because of a)a knowledge and command of advanced technologi
ms rodriguez planted 24 tulips in her flower bed. of the tulips,1/3 are red. how many tulips are red?
A list of numbers in a specific order
Which conclusion about the meaning of Y is correct if the allele combination Yy is for yellow seeds? yellow and dominant green and recessive yellow and recessiv
What are the steps to extract metal from the earths crust
Caleb took 18 photos at the zoo. One sixth of his photos are of giraffes. How many of Calebs photos are of giraffes?