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

Proof: Given: Isosceles trapezoid TRAP with TR=PA Prove: Angle RTA = angle APR
i need with math it say the ride-it store rents bicycles. the cost is $8.50 for 1 hour, $13.64 for 2 hours, $18.80 for 3 hours, and 23.95 for 4 hours. if the pa
Proof: Given: Isosceles trapezoid TRAP with TR=PA Prove: Angle RTA = angle APR
In the step by step simplification of expression below which property is not used? 3(1+x)3(x+1)3(x)+3(1)3x +3  A) associative B) commutative C) distributive D)
You have a piece of wood that is 7 3/4 feet long.  You want to cut one piece that is 3 7/12 feet long and one piece that is 4 1/12 feet long.  Do  you have enou
i need with math it say the ride-it store rents bicycles. the cost is $8.50 for 1 hour, $13.64 for 2 hours, $18.80 for 3 hours, and 23.95 for 4 hours. if the pa
Proof: Given: Isosceles trapezoid TRAP with TR=PA Prove: Angle RTA = angle APR
Proof: Given: Isosceles trapezoid TRAP with TR=PA Prove: Angle RTA = angle APR
Proof: Given: Isosceles trapezoid TRAP with TR=PA Prove: Angle RTA = angle APR
A laptop computer is priced at $650. If the sales tax is 5%, find the total cost of the computer, including sales tax.