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

Ria’s age is x years old.Jai’s age is x/2 + 5.If Jai is elder than Amit,which of these could be the possible relation between Amit’s and Ria’s age?
What is a current density?
2x – 3 = 3 solve by graphing​
As we approached behind them, we could see only the clusters of white people that stretched for a distance of two blocks along the entire span of the school bui
What are the quotient and remainder of (3x³ - 2x² - 8) + (x + 5)? a. 3x² - 17x+85; 433 b. 3x² - 17x+85; -433 C. d. O A OB O C OD 3x² - 15x+85; 433 3x² - 15x+85;
I WILL GIVE BRAINLIEST Point E is located at 11. Point F is 55 less than Point E. Where is F located?
hi everyone help me pls help​
Katie is 1.58 m tall. George is 9 cm shorter than Katie. How tall is George? Give your answer in cm WHAT IS IT
divied 3.64× 10^8 by 3.3×10^4​
bounce through-the-lens (TTL) flag high-speed sync use high speed synchronization to reduce the risk of over-exposing the image's ambient-litareas allow the cam