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

Critically discuss the impact of negative spectators behavior during sporting events
A sample of a radioactive isotope had an initial mass of 110 mg in the year 1990 and decays exponentially over time. A measurement in the year 1993 found that t
different between management and leadership in business study​
Name of the polynomial expression: -8
WILL GIVE BRAINLIEST IF ANSWERED FAST!!!
just explain how it's not 7 please ​
Find the probability of selecting 4 science books and 3 math books from 11 science books and 14 math books. The books are selected at random.
A spy realizes his cover is blown and flees toward his secret evacuation spot at a speed of 60 mph. Two hours later, a special agent in a helicopter starts chas
please answer this need help​
Examine a partial order relation where is the relation on the set of people such that if and are people and is older than .