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

In DNA, which of the following determines the traits of an organism?
Roman rulers helped unify the empire by granting every free person ________ in ad 212. (1 point) citizenship money land voting rights
Most undocumented aliens enter the united states by _____.
Write a problem that involves finding the unknown measure of a side of a rectangle include the solution?
Is "I take you hand and pull it closer to mine" Imagery???
simplify 3.2-5.1n-3n+5
Find the possible values of the included angle of a triangle with: A) sides of length 5 cm and 8 cm, and area of 15 cm^2 B) sides of length 45 km and 53 km, and
Guys I need help this question is so weird is from IXL plz help
As the united states moves increasingly toward high-stakes testing, _____.
Round 5685 to the nearest 100