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

En la playa describe what these people are doing. complete the sentences using the present progressive tense. el sr. camacho está pescando . felicia está .
In order for cellular respiration to occur, oxygen and __________ are necessary. glucose atp carbon dioxide water
How many times hotter than the sun surface is the surface of a star the same size but gives off twice the amount of energy per second?
Treaty of versailles how did it impact germany and the other nations qyuizlet
Which is true? A 0.0038 > 0.004 B 0.0749 = 0.075 C 0.4731 > 0.5001 D 0.7910 = 0.79
why were the aristocracy in greek city-states so wealthy?
What is the meaning of the quote, "One of the secrets of life is that all that is really worth the doing is what we do for others," by Lewis Carroll?
Roland has purchased a new tablet. How he can avoid risk? Check all that apply. by using a screen protector by letting his toddler play with it by using an anti
What is Quantum Physics?
Which perspective focuses on the biological basis for universal mental characteristics?