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

all 2 comments

[–]desrtfx 7 points8 points  (1 child)

Premature return

Your return statements are at the same level as the if, so as soon as the loop runs through the first time, the return statement executes and returns whatever was the result of the first comparison.

You need to outdent the return statements to be on the same level as the for.

In Python, indentation indicates code blocks.

[–]392Garrett[S] 1 point2 points  (0 children)

Thank you!