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

Read the sentence. Aunt Rita _____ my frequent visits, even when I arrive on short notice. Which word gives Aunt Rita’s attitude toward the visits the warme
What is the difference between a mixture & a pure substance?
COUNTY ATTORNEY (with the gallantry of a young politician). And yet, for all their worries, what would we do without the ladies? (The women do not unbend. He go
Which of the following is NOT one of the three basic economic questions? a. What goods and services should we produce? b. How should we produce those goods and
What is the length of the area if 8 1/2 feet and the length is 3 2/5 feet?
What is the area to a 2 3/4 inch square?
What’s one way a power plant might spin a turbine?
Which of the following helped fund military expansion during wwii? black market war bonds depots rations
Which statement best expresses the main claim of "Say No to Library Cuts"? You can let Mayor Eckrich and his staff know how much you value the library and
Wes bought a pizza with 2 toppings from Bill's Pizza Place for $11.00. Lisa bought a pizza with 5 toppings from Bill's Pizza Place for $14.75. Each topping at B