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

which state of matter has the least amount of energy?
Dominick lives 1 3/4 miles from his school.  If his mother drives him half the way, how far will Dominick have to walk to get to school?
If 8 men can chop down 28 trees in one day, how many trees can 20 men chop down in one day?
After what happened on April 19 can war between the colonies and Great Britain be avoided?
What is the mean of 87, 93, 86, 90, and 84?
If 8 men can chop down 28 trees in one day, how many trees can 20 men chop down in one day?
Why was is difficult for the Arab people to form one nation?
Which of the following can be considered fossils? a. a 1 billion year-old rock. b. a 1 billion year-old piece of amber. c. a 1 billion year-old piece of amber w
5x+4y+100 in slope intercept form
Determine whether the sequence coverage or diverges. If it converges, give the limit. 48, 8, 4/3, 2/9, ...