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

What amount of moles does 60.5 L of carbon dioxide occupy at 50.5 kPa and 20 degrees C?
After a program has downloaded to a PLC, what must be selected?
The local school district has made a scale model of the campus of Engels Middle School including a proposed new building. The scale of the model is 1 inch = 3 f
What numbers would be in the in the 4 sections of a 2 x 2 array that shows the problem 18 x 17? 100, 80, 7, 56 100, 80, 70, 56 100, 80, 70, 15 10, 80, 70, 56
Please help me with this
The graph solves this system of equations. What is the solution to the system? Use the drop-down menus to explain your answer. 4x + 6y = 8 y = −23x + 13
HELPPP MEEE PLEASE I WILL GIVE BRIANLEST
Dana is given the total surface area of a rectangular pyramid. She is asked for the lateral surface area. Describe how Dana can use the given information to det
simplify 7/8 x 1 1/3A. 7/24B. 28/24C. 1 1/6D. 1 7/24​
help me with this, I was never taught how to do this...