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

40 points if you answer these Comprehension Questions for The Wave When and where did this experiment occur? What was Mr. Ross' motive for the experiment? What
Approximate the length of the diagonal of the square to the nearest tenth. the square sides are 6
What is the inequality for this problem and the symbol
Which of the following is/are not key points of competent communication? Select all that apply. 1. Communication should be informed by the setting and the task.
2. Why are recipes important in the culinary arts world? Name two reasons.
Give AB=19mm,BC=14mm, and AD=51mm, find the length of CD
If Kp = 0.15, which statement is true of the reaction mixture before any reaction occurs?
Which pair of words correctly completes this sentence? Los ________ y las _________ son plantas que crecen en un clima tropical.
A(n) ________ occurs when a voter can wait until the day of the primary to choose which party to enroll in to select candidates for the general election.
Billy drops a water balloon from the roof of his house since the balloon begin with an original velocity of zero how far above ground was the balloon dropping i