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

The Tabernacle was set up in Canaan at: Gilgal Shiloh Hebron Mount Ebal
A cell with a diploid number of 36 undergoes meiosis, how many chromosomes are in each daughter cell?
What is the function of the pancreas? What is the function of the liver?
When going out for drinks and pintxos with friends in san sebastian, who usually pays?
Which pair of legislators are known for their ability to compromise on states rights
The length of a rectangular garden is 5 feet greater than the width. the are of the rectangle is 300 square feet. find the length and the width.
What is one way to find the total cost of a jacket for $55.80 with a sales tax of 2.7%
What transformation is represented by the following coordinate mapping? (a,b) → (a, -b)
A woman who gave birth to a second child 3 weeks ago is depressed and having difficulty caring for her children. at the end of the day both of the children are
Show your work. Simplify: 7.8x9/4