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

You purchase a total of 45 shares of stocks from 3 different companies. You purchase twice as many shares of company c stock as you do company a. Company a stoc
Solve for the variable X=5y for y
-3/4 (-4) please provide answer and how to solve it
How many Jews did Adolf Hitler killed
Write an equation yo model each situation then solve ! A stack of 12 bricks is 27 in. High. What is the height of each brick
An adult blinks about 450 times in 30 min. A 12 year old blinks about 150 times in 15 min. How many more times does an adult blink in 60 min. than a 12 year old
What is 3.100 in written form
What is 1/3 of 9 if u know please tell me thanks
what is the domain and range for y=lxl
55/100 in simplest form?