115k views
2 votes
4.9 Code Practice: Question 1 [Intructions shown]

Instructions:

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

4.9 Code Practice: Question 1 [Intructions shown] Instructions: Write code using the-example-1

1 Answer

4 votes

In python:

total = 0

for x in range(3, 67, 3):

total += x

print(total)

I hope this helps!

User Probablybest
by
7.1k points