Welcome to Westonci.ca, your ultimate destination for finding answers to a wide range of questions from experts. Connect with a community of experts ready to help you find solutions to your questions quickly and accurately. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

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

Sagot :

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)