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

The Chinese nickname for themselves, Zhong Guo, translates to: A. First Peoples B. Middle Kingdom C. Children of the Sun D. Earth's Center
Chloroplasts contain saclike photosynthetic membranes called.
pls help im bad at math i need help as soon as i can can get it
Martin kimani representing kenya at the u. N. States ""this situation echoes our history"" and then describes how modern africans did not draw their own borders
I need help with Spanish 2! Will mark on brainlist!
Ryan's school had decided to disallow students from using cell phones. Students could no longer bring cell phones to school. Knowing the meaning of the root wor
Explain why the process of industrialization is called revolution, and summarize the effects of industrialization on the people of the er
In "Heat," which symbolic importance or meaning does the heat take on? Question 7 options: The heat represents a powerful force that changes the speaker's world
sorry its simple but im stressing​
What are the names of these polygons?