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

Q: What is the indicated term of the arithmetic sequence? someone help!!!! a14 for 200,196,192... A: a. 148 b. 252 c. 144 d. 239
Did Maya Angelou's uncle kill the mom's boyfriend after finding out he raped Maya or beat him to death?
What does it mean when Brutus says: "Into what dangers would you lead me, Cassius... that you would have me seek into myself...for that which is not in me?
What Is Geographic Mobility?
How do you use equal protection of law in a sentence
Acme Inc. spent $870 less on postage than on supplies. The ratio of postage costs to supply costs was 2 to 5. How much did Acme spend on postage? Solve this pro
90 < x < 180 is my range and my answer is 0.6 for it to be correct is it positive or negative?
luisa has 183 pennies. hert dad gives her 128 more write a number sentence to show many pennies luisa has now
what does the expression "what ever floats your boat" mean?
what is the fraction ten twelfths in it's simplest form ?