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

plez help me and show your work
When the variable religious affiliation is classified as protestant, catholic, and jewish, this variable has the important quality of being?
Why did native americans fear the encroachment of settlers?
Different species that occupy similar niches in isolated areas develop morphological similarities. this phenomenon is called _____.
What were some popular types of games in the 2000s?
Imagine that you are on a special meal schedule and you eat either a meal or a snack every two hours and twenty minutes. You alternate a meal, then a snack, sta
Giving 30 points to whoever helps me.Fasttttt and no wrong answers.
How long does the average high school relationship last?
A sample of propane (C3H8) has a mass of 0.47 g. The sample is burned in a bomb calorimeter that has a mass of 1.350 kg and a specific heat of 5.82 J/(g • °C).
question down below please answer if you know the answer! thnx so much :)