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

Jackie buys a basket for $6, 2 pounds of apples for $3.50 per pound, and 2 pounds of oranges for $3.50 each per pound. The tax for the whole purchase is $1. Ex
A line segment that has one endpoint at the center of a circle and the other endpoint on the circle?
What was the official u.s. response to the japenese attack on pearl harbor?
Peter is playing dominoes with a standard double six set and begins by laying the double six . He then continues to play dominoes, but in one direction, until h
The treaty of versailles a. was a fair and reasonable document given the circumstances. b. allowed germany equal participation in the negotiation process. c.
Why is the database management systems (dbms the heart of the database functionality?
When was the term acid rain first used? 1960 1753 1980 1852
Which best explains the symbolism of changeing weather in "the jilting of granny weatherall"?
English extra credit please help.................. There are two ducks in front of a duck, and two ducks behind a duck, and one duck in the middle. How many du
In almost any occupation, the higher the level of education attained, the higher the _____ will be. insurance salary stress amount of work