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

if any of you guys can help it would be greatly appreciated this is due tomorrow ​
Please tell me the answer
During a Zoom, Adeja and DaisJa offer the class HELP Is this a Direct Object Predicate Adjective Adjective Subject Predicate Nominat
PLZZ HELP! Given the function f(x)=2(x-1)^2+3 a)What is the vertex? b)What is the axis of symmetry?
May I please have help on these problems for my sister?
Find the distance between these points. R(-1, 0), S (8, 6) √(26) √(85) 3√(13)
What inequalities have the solution set graphed in the number line? Select two options.
HELP ME PLEASE !!!!!!!!!!
What are some ways to address unemployment in a market economy? Select three answers. creating new projects increasing regulation lowering restrictions raising
Write three fractions that are equivalent to 1/2 Use a diagram to show how you know you are right.