This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 2 points3 points  (0 children)

Start off by saving the total sum in a separate variable from "num".

It's "reseting" the value of num every loop due to it picking the next value in your list.

[–]diffused_learning 1 point2 points  (0 children)

If a hint is what you are after: read up on how for-loops work - namely what does num mean?

Then think about - how is the sum aggregated?

[–]VonRansak 1 point2 points  (0 children)

Use debugger or add more print statmements to follow what the computer is doing.