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

What was the Atlantic Charter?
The major cause of ozone depletion is?
name a set of parallel lines
Which queen was a great patron of william shakespears's works?
HELPP please in number 19 thank u so much
which of the following physical features is located only in china? The Himalayas The Gobi Desert Three Gorges
I need help with #4 and if you can help me with #5 that would be great thx
Aurora, a city on the Fox River, was the first town to install electric street lights. Which word or phrase is an appositive or an appositive phrase in the sent
The systematic mass slaughter of European Jews and others in Nazi concentration camps during World War II is called the Holocaust. a. True b. False
How did "Female Workers of Lowell" benefit women? 3 Bullet points minimum please.