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 is the force that causes a 8 kg object to accelerate at 4 m/s^2
This is the ability to produce energy at work​
11. multi-Step The secret code for a math competition is 382 less than 5 times 861. What is the code? (A) 2,771 B) 4,687 © 3,923 D 1,049​
You run a 3 mile race. How many inches did you run? Show work
One saw and 4 hammers cost $72. Two saws and 6 hammers cost $114. How much does each item cost?
1.Part A: Which of the following identifies the best central idea of the text “Zero Waste”? Highlight your answer. 5 points A. Styrofoam, he learned, couldn’t b
I WILL GIVE BRAINLEST Choose the word that best completes each sentence. 1. Victories for the army and the navy helped confidence in the American military. 2. T
Why was Catalhoyuk an ideal location for early development? (PLEASE HELP!)
is it true or false thatnot all language havegrammar system? explain.​
John Riley, A certified public accountant, has worked for the past eight years as a payroll clerk for Southeast industries, a small furniture manufacturing firm