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

GIVING 19 POINTS!!!! The questions below refer to Lee's letter on secession. 1) According to Lee's letter, the greatest disaster the country could face would b
A square playground has a white line drawn through its diagonal. This creates two triangles whose angle measures are 45°, 45°, and 90°. If the sides of the play
In your own words, why is using an outline to take notes a good strategy?
Let angle a =40.If angle b is complement of angle a, and angle c is a supplement of angle b, what is angle b + angle c
What is funny about Thurber's story's title.
What is the factored form of each expression? 20x + 35y
New artistic techniques of the Renaissance throughout Europe included the use of each of the following except a. chiaroscuro c. emotion b. perspective d. abstr
A sphere has a diameter of 24 units. What is its volume in cubic units? A.576π cubic units B.1,728π cubic units C.2,304π cubic units D.6,912π cubic units
¿Cuál no es un ingrediente de una pizza?
is d/t=r an equivalent equation to d=rt