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

In which ways did the king deny the colonists life liberty and the pursuit of happiness
Write a while loop that sums up the squares of the integers from 1 through 10.
What is the general underlying cause of shock?
What were some of the earliest forms of life on Earth?
What does the poetry of colonial America tell you about the period?
Microbes that grow readily on the benchtop or in a temperature-controlled incubator that is not sealed from the atmosphere in the room are ___.
What is number in front of a chemical formula in an equation that indicates how many molecules or atoms of each reactant and product are involved in a reaction
The nurse is reviewing aspects of cultural care. which statements illustrate proper cultural care? select all that apply
Statistics show that one in five people in the world are severely _____. A. over educated B. undernourished C. underestimated D. over fed
What is the land like in the south and southwest parts of Asia?