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

One way to begin the communist revolution was to create among the workers.
Which of the following is not an example of Gothic stained glass windows? storytelling windows dichromatic panes of white glas s rose windows illustrations
A food web in a certain ecosystem consists of seals that feed on krill, which in turn feed on phytoplankton. Extensive krill fishing reduces the krill populatio
Help with math plz! Giving brainlist
HURRY PLEASE!! When gasoline is burned in a car engine, ________ energy is converted into _________ energy. A) heat, chemical B) chemical, potential C) mecha
At a​ school, 171 students play at least one sport. This is 60​% of the students at the school. How many students are at the​ school?
Which type of propaganda technique involves showing people doing every day things?
The data set shows the number of hours per week that each student in a class spends studying at home. What is the shape of the distribution for this data set?
put the definition of metaphor in you're own words
Thx for your support