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

is steel and metal are the same thing???
If you have to decide to claim a credit or deduction on your taxes which should you take?
Dave builds sheds. The widths of the doorways for the sheds vary with the area of the shed. One of Dave's sheds has an area of 24 square feet and a doorway that
Algien me puede dar la etapa interpretativa del cuento el cohete distinguido ese cuento es de Oscar Wilde
Please Answer in A B C D
Joe was looking through a numeric puzzle book and found the following puzzle. The sum of two numbers is two. The difference of the two numbers is also two. What
Humans use over 100 different amino acids. True. False ?
In the adjoining figure, AB = DC, ∠BAC = ∠BDC = 90ᵒ, Which of the following statement is true?
How can language be used to persuade or manipulate shared knowledge?
What is the difference between Hinduism and Buddhism and Sikhism and Jainism