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

1. Which foreign countries have supported the Assad government?
An unexpected harsh dissonance coinciding with the word death is an example of.
Which of the following pairs a land cover with its most appropriate use? A. Rangeland → industry B. Urban land → Growing crops C. Developed land → Grazing lives
-Free Labor for the use of Public Works projects in the colonies was a form of Forced Labor Systems
Determine if the two triangles are congruent. If they are, state how you know A) ASA B) AAS C SAS D SSS
i have to write a persuasive essay about why do i prefer taking an exam online than school or the opposite. any help??
Given the circle below secant kjI and tangent hi find the length of hi round to the nearest tenth if necessary.
How did the space shuttle Challenger affect the course of Sally Ride's career?
The average cost of regular gasoline per gallon in 2014 was $3.34. In 2015 it decreased $0.94 per gallon in 2016 it decreased another $0.27 per gallon. The aver
What is the most likely reason why kennedy decided to include the phrase "ich bin ein berliner"? to announce his dual citizenship to show his support for east g