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

five times the difference between 3/4 and 1/2
In 2022 the chiefs regular season was 14-3 .What was their winning percentage? You may use your ipad calculator.Round your answer to the nearest thousands
A unit that has been reinforced with elements of another unit has a _____ symbol at its upper right corner. A unit that has elements detached has a _____ symbol
Did you eat dumplings in ancient times?
what the domain of y=-(x-20)^2+20
find the length of the third side
Is d+6d equivalent to 6d
Write the following in standard form Show your work. -9x + 6 = 3y
3 to the exponent of -3 is?
How are the intermolecular interactions represented differently in the solid model and the gas model why?