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

The ratio of the perimeters of two similar triangles is 4:3. What are the areas of these triangles if the sum of their areas is 130cm2?
What experiences led to the American Revolution?
Can you help me with my homework
If the sum of two natural numbers is 8 and their products is -33 .find the number​
if angle theta is an acute angle such that cos theta =1/4, find sin theta/2
Which set of elements have similar physical and chemical properties? carbon, nitrogen, oxygen helium neon, argon hydrogen, lithium, beryllium fluorine, chlorine
when 2.40 moles of sodium react with 5.90 moles of chlorine gas in the reaction shown above, how many moles of sodium chloride are produced ?
tattoo how is it made
Find the surface area of the pyramid to the nearest whole number.
Find the circumference of the circle