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

explain the chemical reactionI need friend ,,, anyone like to be my friend ,,lol​​
The condition of muscle fatigue is best explained by: Question 1 options: insufficient intracellular quantities of ATP due to excessive consumption the inabilit
Bob sells the vegetables he grows in a farmer's market. Bob is a little disorganized and has been looking for a good way to track his sales. If Bob creates a da
Do you support the zero tolerance policy or repeal it? why or why not
What is the largest prime number less than 200?
Mengapakah penggunaan mikroskopelektron penting dalam mengkaji sel?​
A website such as Lucky Brand can target each of the following with remarketing, except Group of answer choices everyone that has visited any page on Lucky Bran
Express sin O as a fraction in simplest form
All organisms need a place to live that provides? I
what is a sign that person may need help for a mental dsorder?A. Spending more time listening to music B. Experiencing sudden changes in interests or hobbiesC.