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

Pleaseee help me, I don’t speak English so, I don’t understand this, and I need pass this class Please be thoughtful and respond in at least 2 complete sentence
Solve for x. 6x + 238= 3x + 178
Hypothesis of Rural-urban migration​
What was Cardi B's latest song.
what is the elemrnts and shape of mimarofa​
Masaccio pioneered what style of realistic art?
Help help help help help help
Which of the following is true about inertia Select the correct response: O It is not related to the mass of an object It can be calculated by dividing distance
PLS HELP ME !!! i will give you 20 points
Which of the following reactions best describes the acid-base properties of acetic acid (CH3COOH) in an aqueous solution? O CH3COOH(aq) + 4H2O(l) 4H30+ (aq) + C