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

Learning patience and humility is which part of Odysseus's epic journey?
Google Maps is an online atlas. a. True b. False
If you need a routine health checkup what facility is most cost effective
If the probability of picking a red marble out of a bag is 0.4 and the probability of choosing a green marble out of the same bag is 0.25 what is the probabilit
when we plot all the points that satisfy an equation or inequality we what it?
When should you suggest a client use progressive muscle relaxation? A. When the client is stressed while driving B. After the client eats a large meal C. Bef
Point B is located between points A and C, AB= X^2-10, BC= 2X +2 and AC= 16 ,solve for X
The tongue is covered with hairlike projections called what?
What is (-2^3) ^2/3 and why?
What Number is 10 times as great as 7,962?