Serenaark6707 Serenaark6707
  • 02-07-2021
  • Computers and Technology
contestada

Write code using the range function to add up the series 3, 6, 9, 12, 15, ..... 66 and print the resulting sum. Expected Output 759

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 08-07-2021

Answer:

The program is as follows:

total = 0

for i in range(3,67,3):

   total += i    

print(total)

Explanation:

This initializes the sum of the series to 0

total = 0

This iterates through the series with an increment of 3

for i in range(3,67,3):

Add up all elements of the series

   total += i

Print the calculated sum    

print(total)

Answer Link

Otras preguntas

I need your help please❤️ you place $6543 in a savings account which earns.7% interest compounded semi annually, after 3 years how much money do you have?
Who helped fight against russia in the crimean war?
Rhea is solving a math puzzle to find the solution of the puzzle she must find the product of two numbers the first number is the sum of 23 and X in the second
14. Compare the graphs of the inverse variations. Please provide at least 3 comparisons
_______ rose to power by restoring order in Afghanistan after the war with the Soviet Union. A. Al Qaeda B. The Taliban C. Saddam Hussein D. Osama Bin Laden
Find a parametric representation for the surface. the part of the plane z = x + 3 that lies inside the cylinder x2 + y2 = 9. (enter your answer as a comma-s
What are the four different types of monomers that make up each biomolecule?
The two triangles are similar. What is the value of x?
What allows simple transformers to step voltage up or down?
In the shame of the cities, lincoln steffens argued that people needed to: