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

how do we rewrite the equation y=-x 4
9times 27 plus 2 times 31 minus 28
when adp molecules gain phosphates, they become atp molecules. true or false
house numbers on one side of a street are consecutive even integers. the sum of the first three house numbers on the street is 6216. what is the number of the t
Salt {strategic arms.limitations treaty} I SALT II and start treaties were all examples of the United States A. Trying to diffuse tensions in Western Europe B
Find the value of 6x - 5 given that −17x -9 = 8
what is 12/3 as an improper fraction? a. 2/3 b. 5/3 c. 8/3 d. 6/3 user: what is 20 × 6? a. 100 b. 40 c. 12 d. 120
Which of the following is correct for the effect of linkage on recombination? A. It increases the percentage of recombinants. B. It results in 50% recombinants.
The skin has multiple functions. Which of the following is NOT one of the skin’s functions? A. Works with bones to transfer vital elements through body B. Pre
Identify the polynomial(s) 1. a^2 + bcd^3 2. a^2 + b - cd^3 3. a^2 - b + c - d^3 Choices: • monomial • binomial • trinomial • four-term polynomial • fi