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

The temperature around Earth's equator stays about the same throughout the year. Why does this happen?
Solve the linear equation 2.25 – 11j – 7.75 + 1.5j = 0.5j – 1. j = –0.45 j = –0.25 j = 0.25 j = 0.45
Which web-based application helps businesses save money and time that would otherwise be spent on travel? A. Webmail B. Social media C. Web conferencing D. Wik
Complete the equation of the line through (-8,8) and (1,-10). Use exact numbers.
a cheese pizza cost $5 additional toppings cost dollar fifty write and graph an equation in two variables that represents the total cost of the pizza let T repr
in figure 33-6 what structure is labeled a? what is the role of the delicate network?
What is the net force here and what direction will the object accelerate ?
Renee and cliff announced their engagement at a party friday night. they are in the _____________ stage of the relationship.
hey can you please help me posted picture of question
what is the phylum of a cycad