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

Among the executive branch is checks on the legislative branch is the president‘s power to
North or south? During the Civil War, this religion had the advantage of being home to two-thirds of the country's population, giving it more available men for
60 percent of a number, minus 17, is -65
The population of a town is 16,519 people. Each year the population increases by 4%. What will the town’s population be in 15 years? Round your answer to the ne
- (-2(-x2)2) = soooo im just typing this cause it says i have to have at least 20 words but like what
WILL MARK BRANLIEST!!!!!!!! HELP ASAP!!!!!!! Which western state has an involvement in the space industry? California Oregon Washington Idaho
What current does a 175 ohm resistance draw on 220 volts?
y=-3x-6 y=-4x-9 Solve using substitution please
A recipe calls for 1 fourth cup of flour carter only has a measuring cup that holds 1 eighth cup how can carter measure the flour he needs for his recipe
Which sentence from response to Erik of Sweden best summarizes Queen Elizabeth’s purpose for writing the letter