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

According to the geological time scale, in what era did most types of animals first appear? -Haden -Paleozoic -Mesozoic -Cenozoic
who started calling them 'founding fathers'?
definition of diverse nation
Skill-based outcomes include acquisition or learning of skills and use of skills on the job. a true b false
when was the united states of america founded?
10) the __________ theory of aging suggests that the elderly who are most successful while aging are those who maintain the interests and activities they had du
Which is not a celtic language? a. welsh b. breton c. greek
For a rectangular prism, if the base length was shrunk by a factor of two-thirds, the width was quadrupled, and height was cut in half, how would the changes af
According to Adam Smith, the government should be responsible for a.encouraging producers to act in their own self-interest. b.imposing tariffs and quotas on an
the vertical sequence of the layers of soil is called a soil what