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

How to graph 8+4x=2x
At one time, the Texas Junior College Teachers Association annual conference was held in Austin. At that time a taxi ride in Austin was $1.15 for the first 1/5
how to slove multistep equation 2/5(x-2)=-3
The fundamental purpose of the starting phase of a project is​ ________.
Brandon has 7/1/2gallon of paint. He plans on using 1/1/2 gallon on each room. How many rooms will he be able to paint.
Show that for the same shear angle, there are two rake angles that give the same cutting ratio.
when i was 6 my sister was half my age now that im 70 how old is she????
in the declaration of independence, whom did the american indict for "repeated injuries and usurpation"?
In the _____ stage of group development, members typically try to get a feel for what is expected of them, what types of behaviors are out of bounds, and who's
Which Chinese thinker believed that peace and stability could be brought to China if all people treated one another with respect? A. Tang Taizong B. Tokugawa Ie