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

I need help with Number 6 Please include an explanation if possible
Which expression are equivalent to the given expression
Find ‘x’ in :- x: 6:: 5 : 11 Please make it an easy explanation...Please
1 2/3 divided by (-2 3/4) in simple form please answer fast for a quiz on monday this is my cheat sheet lol need it fast bo !!!
Indicate whether each of the following speech acts is direct or indirect, and explain your answer in each case : 1. Do you know that the word 'kiwi' can be a fr
write down any two features of plants that grow in cold plce​
Write an equation for the line whose slope is -1/5 and whose y-intercept is 5.
What is a photosynthesis​
If you can write a paragraph out about the following points you'll get +50 points and awarded brainliest. Points over how science and religion ask and answer d
PLZ HELP ITS DUE TODAY