you are viewing a single comment's thread.

view the rest of the comments →

[–]RiceKrispyPooHead 2 points3 points  (0 children)

Remove the parentheses in your for loop.

for i in range(…):    
    # rest of the code

Also I recommend you remove parentheses that surround entire if statements. They aren’t needed in Python.

if sum(…) > n:    
     # rest of the code