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

When 7 is subtracted from a certain number and the result is multiplied by 2, the final number is 18. What is the original number?
Find the value of 2n-3 – 4 =10
WILL GIVE BRAILIEST IF ANSWERED FAST
Emperor penguin can be found on only one continent
In the cuboid below, tan(A) = 3 tan(B) = 4 Work out the value of tan(C). If your answer is a decimal, give it to 1 d.p.
how many foood chans are there in the food web?
Benefits of online learning
Frank Genry brief biography
how are vitamins or supplements good for your health
Internet communication is a revolution in the field of communication. Justify​