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

Chest compressions should be initiated
Flow of a fluid in a conduit will not occur without a difference in .
What do cross cutting capabilities include?
someone help me please serious answers only! Kurt is buying a new cell phone. He knows that the more features the cell phone has, the more expensive it will b
15 point question. please help
how many syllables does contentious have
Select the correct text in the passage. Which word in this excerpt from Homer's Odyssey means "lands" or "kingdoms"? Till now from sea or flood no succour found
HELPPPPPP four interior angles of a pentagon measure 156°, 72°, 98°, and 87°. What is the measure of the final interior angle
Mount Rainier is 14,410 feet high. Mount McKinley is 20,320 feet high. How much taller is Mount McKinley?
Question 3 Unsaved Which statement best describes the polynomial -8x^2 ? Question 3 options: first degree polynomial with two terms first degree polynomial wi