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

In order for a boat to float, its weight must have a magnitude equal to the
the definition of the word acute angle as a biconditional statement
Solve 7 - 5(2 - x) = -(x - 8)
Meaning of battle sweat
Consider the reaction: C + O2 rightwards arrow CO2 + 393 kJ. When 2 mol of carbon react
Which of the following african groups did not form a kingdom? a. hausa b. bantu c. gikuyu d. bini
In the western states, a dry creek is called an arroyo or _____.
Which statement about electric force is true?
what are the zeros of the quadratic function f(x) = 2x2 – 10x – 3?
you uses 500 mg of sucrose and placed it into 200ml of water what is the concentration of this solution?