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

Traditional medicine that focuses primarily on the treatment of illnesses with medication, rather than illness prevention and wellness, is sometimes referred to
the speakers use of pauses in her speech reflect that she is all of the following except
What actions by the colonists surprised john adams?
what is the distance around a triangle that has sides measuring 21/8 feet, 31/2 feet and 21/2 feet?
If mc018-1.jpg and g(x) = 5x – 4, what is the domain of mc018-2.jpg?
Many researchers hope pig organs will one day be successfully transplanted to humans. What would an advantage of successful pig-human transplants?
How can you avoid getting a flat tire 1.3?
Write a simplified polynomial expression in standard form to represent the area of the rectangle x+5 2x-4
How can finance manager improve revenues?
I don't understand 11a or b. Please help.