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

why dog pants during summer use the cocept of evaporation
If X is the set of negative numbers and Y is the set of positive numbers, then the union of X and Y and 0 is the set of (A) all real numbers (B) all integers (C
Molecular scientists can read the DNA code and compare the DNA of different organisms. This concept is used in molecular clocks to determine which of the follow
What's the word for to talk on and on pointlessly, without clear direction
which designer started as a fashion illustrator before focusing on industrial design?
What's the other word generous in overlooking insult or injury by others; rising above pettiness
What was the major purpose of the Truman Doctrine?
Which expression is equivalent to 27/125
How did Niccolo Machiavelli’s book The Prince set him apart from other writers of the Renaissance?
What would cause a decrease in the quality of circulating red blood cells