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 pH of human blood is slightly basic. Which of the following is most likely to be the pH of human blood? (A) 10.6 (B) 7.4 (C) 7.0 (D) 6.4 (E) 4.6
Greg ran 3 times as far as jed.rj ran 0.1times as far as Greg. If jed ran25 yards, how far did Greg and rj run
When Mendel crossed two hybrid plants for stem height (Tt), what results did he always get?
Two cars leave a town at the same time heading in opposite directions. One car is traveling 12 mph faster than the other. After 2 hours, they are 232 miles apar
One of the biggest pull factors that lured people to move West was cheap land. true or false
The largest ethnic group in Nepal are the Bhote. true or false
Is 0.500 greater than 0.50 and 0.5. explain please.
Energy from hot magma is called ____.
Is a church more than a building? Answers need to be long
How does a universal genetic code relate to the hypotheses about the origin of life on Earth?