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

if p=8 evaluate 42÷p×3
The child was born into the power and privileges of the __________. Which word correctly completes the sentence? a. battalion b. militia c. monarchy d. commu
a salt truck drops 39 kilograms of salt per minute. how many grams of salt does the truck drop per second
49.564 expanded form using fraction or decimal
A difference that arose between hunter gatherers and civilizations as a result of Neolithic revoultion
is 16.7 a reasonable sum for 7.5 + 9.2 explain
is melting butter exothermic or endothermic?
the Sanchez family is going on vacation with a drive for 3 hours at the speed limit of 65 miles how many miles will it travel
10.75 convert into fraction
What is 4180 round to the nearest thousand