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

What are the key characteristics of the Indus seals?
Which are elements of a Shakespearean tragedy? Check all that apply.
what very important resource is scarce in the rigion
I WILL GIVE 100 POINTS IF YOU CAN HELP ME ANSWER THIS CORRECTLY!!!!!! Use the quote below to answer the following question: "Being good as a son and obedient as
What is soma in the book A Brave New World?
Which is true of European relationships in the 1500s? Alliances between Catholic and Protestant countries led to greater stability. Wars were common and al
The raised vegetable garden in Susan's yard is in the shape of a rectangular prism with a volume of 48 cubic feet and a height of 3/4 foot. PLEASE DO THE WORK A
Which of the following is an example of commensalism? Feather lice cling to the hairs of flies and use them for transportation. The flies are not harmed. Honey
Is “it is big” a complete sentence
Two of the substances in part 1 are ionic. which factors will result in a stronger ionic bond overall?