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

Why both men and women could become victims of violence
Explain the significance of the judicial branch
4×+.2=.3×+3.9 idk how to do this
HELP PLEASE THIS IS DUE AT 11:28 AM How long did the prohibition era last ? 30 years 13 years 35 years 2 years
PLEASE HELP ME ANSWER THIS!! Use the terms Chaos and Warring states period to write a sentence about China under the Zhou dynasty.
Identify items in your life that are made of each type of element: metal, nonmetal, and metalloid. For each item, explain why the properties of that type of ele
To convert 3 square feet to square centimeters, multiply 3 by 9.29 × 10-2 True or False
which smallest number will have 15,20,25,31 nd 43 as reminder respectively when divided by 20, 25, 30, 36,48 please explain the answer you found
describe how water pollution problems can be managed in a city such as rio de janeiro in a poor part of the world
Jklm is a parallelogram find each measure