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

The Romans adopted many aspects of Greek culture and applied it to their own __________. a. architecture. c. education. b. art. d. all of the above
Solve. 4x – 6 = 3x + 8
Which Soviet leader addressed the terrible economic conditions of the Soviet Union after World War I and the Russian Civil War by implementing his New Economic
Restate the sentence, "You are not telling me what is going on!" to avoid assigning blame and make it a more neutral.
What is the historical purpose of Miller’s The Crucible?
abby is putting tiles on a floor she needs 48 tiles and 8 rows each row has 6 blue tiles the rest are purple how many purple tiles will she need
Find the sum of 362+265. Explain why you did or did not regroup.
EXTRA WORDS IN A SENTENCE THAT ADD DETAIL AND ARE SET OFF BY COMMAS ARE CALLED ___ ELEMENTS
How do decomposers interact with their ecosystem
"Yonder sky has wept tears of compassion" is an example of A. assonance. B. alliteration. C. consonance. D. personification.