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

select all the expressions that are equivalent to 2•2•2•2•2•2​
a loan of $1,050 was repaid at the end of 18 months with a check for $1,075. what annual rate of interest was charged?
what is 86 Fahrenheit degrees into Celsius degrees
in the. Before the Civil War the principle of popular sovereignty method whether or not a territory allowed slavery would be left up to
write about why boarding school is better than the schooling
Pls tell me about the coastal plains region.
Which of the following was not part of the Navigation Acts ?
Amina has a piano recital on Wednesday and a camping trip on Sunday. She spends 30 minutes on Monday and Tuesday practicing piano. After the piano recital, she
PLEASE ANSWER THIS!!!
Scientific writing Task: You charge your cell phone every night while you are sleeping. Throughout the school day you see your cell phone battery slowly decline