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

FREE POINT'S FREE POINT'S FREE POINT'S
Which literary device is used in this poem?
if $a$ is the sum of the positive divisors of $500$, what is the sum of the distinct prime divisors of $a$?
Which literary device is used in this poem?
100 points again 100 points again 100 points again
sydney is among the first places to celebrate the new year each year. which ancient civilization is believed to be the first to celebrate the occasion?
Which set of numbers can represent the side lengths, in inches, of an acute triangle? 4, 5, 7 5, 7, 8, 6, 7, 10 7, 9, 12
Which expression is equivalent to the expression represented by the verbal phrase? 25% of the quantity of 208 plus n A. n + 5,200 B. 25n + 5,200 C. n + 52 D
Justin is walking around an area that has few trees and many tall grasses. In which biome is Justin most likely walking? A deciduous forest B grassland C desert
FREE POINT'S FREE POINT'S FREE POINT'S