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

tanya bought the least expensive brand of dog food. she used a $5.00 off coupon for the purchase. how much did tanya payfor a bag of dog food?
How do you rewrite -1(x-2) without parenthesis?
Please help!! What is the product of the polynomials below? (8x+8)(x+3) A) 8x^2+34x+24 B) 8x^2+32x+24 C)8x^2+11x+16 D)8x^2+16x+32
10. A rock that forms from cooling lava is classified as an _____. a.extrusive igneous rock b.extrusive metamorphic rock c.intrusive igneous rock d.intrusive vo
Why did Mesopotamia create a writing system
142 is 120% of what number
Why is the cardiovascular system important?
find the base of a parallelogram with an area of 24 square feet and height 3 feet
What is the difference between speed and velocity and give an example.
Two planes left an airport at noon. One flew east and the other flew west at twice the speed. After 3 hours the planes were 2700 mi apart.How fast was each plan