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 value of x in the equation 1/3x-2/3=-18 ? O -56 O -52 O 52 O 56
Why did the Wright Brothers send a letter to the Smithsonian Museum?
Which of the following best describes the relationship between the level of genetic variation and adaptability?
PLSS HELPP IMPORTANT (WILL GIVE BRAINLIEST)!
Find the value of X 4.5 8.9 6.5 X 13 b 11 can someone answer
How do you tell your family something important
The cephalocaudal pattern is the sequence in which the earliest growth always occurs at the
what is 43-3y=16 find the unknown?
Jasmine made a line plot to show the lengths of string in inches that the art teacher gave her for a craft project. A line plot named Which of the following sta
99x78 123x56 98x172 38x900