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

Photo attached. 15 points please help.
Find the polar equation of the conic with the focus at the pole, directrix x = 4, and eccentricity 1. (picture provided)
which point is a solution to the inequality shown in this graph
The income received by a country's people from all sources in a given time period
how many elements occur naturally on earth?A. 117B. 25C. 92D. 82​
explain why britain was far from democratic during the early 1800s
At a local grocery store, a 16-ounce bottle of apple juice costs $3.20. What is the cost what is the cost of apple juice per ounce
Write a one-page essay analyzing the current and future impact of population growth on the world. — Include its effects on the food supply, natural resources,
Given a circle with a diameter of 4, what is the circumference? A) 3 pi B) 4 pi C) 6 pi D) 8 pi
how are white and black created