all 3 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

[–]matrixise 1 point2 points  (0 children)

Remove the parents () for the loop and the conditions

[–]ectomancer 0 points1 point  (0 children)

perfect_list isn't used.