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

How do I solve the two step equation 4(x+8)=44
Rna splicing is catalyzed by a complex of rna and protein referred to as a
Ronald likes to use his erector set more than anything else. When someone recently asked him what he wants to be in his adult life, he shrugged and replied, "O
Why is my foot asleep and im not sitting on it?????
After the renaissance, trade was greatly restricted true or false?
you download a digital album for $10. Then you and your friend download the same number of individual songs for $0.99 each. Write a system of linear equations t
Someone explain this equation plz
The first part of the LRAS Curve conveys an economic recession. What does this mean? A. The economy is inefficient and has excess capacity for production. B.
How many equal parts in 5/8
Long-term mineral extraction has no lasting consequences. true or false