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

Determine if the numerical value describes a parameter or a statistic. A recent poll of 1887 corporate executives showed that the average price of their cars
Use the drop-down menus to indicate the order in which the steps should be done. Chop the clean fruit into chunks-1234 0r 5 Mix the chunks together-1234 0r 5 Dr
What is visitor in kiswahili
The highest point in a park is 235 feet above sea level. The lowest point is 32 feet below sea level. What is the distance between the highest and lowest points
During this time, civil rights leaders largely agreed to: A. Forget issues and fight to defend democracy B. Quickly gain as many jobs and homes as possible duri
The radius of a circle is 8 yards. What is the circle's area?
What can individuals do to help shape a new government?
You put $500 in the bank, where it ears 1.5% simple interest every year. How long until your money will triple?
i am new so i have no clue what i am doing but i have a question. what are the points for and what do you do with them?
Which of the following situations are equal to 2? Select all that apply. A) 75% of 3 B) 20% of 5 C) 10% of 20 D) 50% of 4 E) 25% of 8 If you answer this you wil