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 of the following best describes why the Farmers’ Alliances formed the Populist Party? A) The Farmers’ Alliances were not successful in changing the crop-l
two staments that show the relationship between the values of the numbers 0.5 and 0.05
identify at least three different types of clinics
A truck weighs 72,429 pounds. when rounded to the nearest ten thousands the truck's weight will be
How would you describe the behavior of particles in a solid? a. They don’t move very much and do not change position. b. They crash into each other and bounce
What was the name of the document martin Luther posted on the doors of castle church?
Which is a characteristic of various kinds of world map projections? A. They cannot include enough detail to be useful. B. They distort scale and landmas
In which area do the United States' state and federal governments share power?
a = 3b + 9 solve for b
How to simplify -8(12x-12)