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

A user is concerned about losing critical data on single computer in the event of an unforeseen system crash. The user is advised to implement fault tolerance.
Your book discusses the general process by which scientists go about thinking about the world. There is a series of steps that are often followed (though this f
overproduction reword?
Given the equation 7m − 11 = 5m + 43 and the possible solution set S: {2, 27, 54, 86}: Part A: Determine which integer(s) in the solution set makes the equatio
جس کا کام اسی کو ساجے اخلاقی کہانی
What is the area of the composite shape. Use 3.14 for n and round to the nearest hundredth. Show all your work​
جس کا کام اسی کو ساجے اخلاقی کہانی
High protein intake overburdens this organ so should be limited in those with impairment of this organ is ______________
what would the two slopes be
1. The Snyder’s spent $31 on movie tickets for 2 adults and 3 students. The Ramos family spent $26 on tickets for 2 adults and 2 students. What are the prices