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

50.0 g of nitrogen gas (N2 ) are kept under pressure in a 3.00 L container. If the pressure is kept constant, how many moles of nitrogen gas are present in the
Explain this sentence.It gets infuriating when the options to skip the ads are not available​
pls help w b. also not sure if what ive written down is right
when data has been processed and is meaningful, which of these has it become?
What is the equation of the line graphed below
The meaning of children marriage and state two reasons why child marriage is still prevalent​
How is perimeter helpful in daily life?
A species was added into a particular ecosystem to control the population of a prey species. This method of introducing a new species is called. The population
In at least 150 words, describe how the American Utopia that Crevecouer describes is just that—a utopia, an imaginary place in which everything is perfect.
Using lowercase letters only, type always, sometimes or never as your answer to the following prompt. The mode of a data set is____equal to the mean. Always So