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

LCM of 3/4 and 5/6 turkey breast chicken plate
micahs room has four sides and a perimeter of 48 feet. if 3 of the sides are 12 feet long, how long is the fourth side?
If a population is in Hardy-Weinberg equilibrium, when is the number of heterozygotes at its most?
Apartheid is best described as the system used by __________.
A. Answer the following questions about the reading selection in complete Spanish sentences. When you are satisfied with your answers, attach them to 2.07 Asig
Find an equation of the tangent line to the curve at the given point. y=secx (pi/3,2)
ate the domain and range for the function f(x) = –x^2 5.
Worsley produced several safety-pins from some corner of his garments and affected effected afflicted effectuated some temporary repairs that really emphasized
please help what is q-75=50
Problem 1: For which of the following activities might you want to hire a chemist? A. building a garage B. testing a sample of water from a well C.