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

Introduced species are very beneficial to ecosystems when they are brought into them. True or False? I say False
What is the GCF for 24, 48m
Is there human interference in the desert ? If so what type?
A(n)___ is divided into rows and columns. What goes in the blank?
The build up of the US military in 1916 was an example of
is 0.21 greater than a half
Why does Darnay try to sever his relationship with his aristocratic family? A. Darnay fears that Lucie will not marry him if she knows about his family. B. Dar
WHAT IS 5X SOMETHING THAT EQUALS 120 BESIDES 24 X 5? SOMEONE PLEASE
110 as a product of prime numbers
Napoleon’s rule made Europeans love France and ended any desire they had to rule themselves. It deprived them of a unified code of law. A. True B. False