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

Hi, PLEASE HELP! In △ABC, m∠A=32°, m∠B=25°, and a=18. Find c to the nearest tenth. A. 28.5 B. 26.1 C. 25.2 D. 27.6
Rachel invested $7511 in an account at a rate of 2% and gained $ 600 88 in interest. How many years did she invest her money if the interest was caluculated usi
Where was the first war in America
If two objects with different masses are pushing each other, which exerts the greater force? 1. The object with the smaller mass exerts the greater force on the
describe the CPU fetch execute cycle in reference to registers ​
In what sense was the British feminist Mary Wollstonecraft an Enlightenment thinker? She wrote passionately about the need for better educational opportunities
Francois and Perrault are
someone please help me!
a 150 kg object takes 1.5 minutes to travel a 2,500 meter straight path. It begins the trip traveling 120 m/s and decelerates to a velocity of 20 m/s. What wa
how to solve 2x + 3 = 4(x - 1 )