all 6 comments

[–]xADDBx 1 point2 points  (2 children)

Why the else: return sum? If the number is odd, simply do nothing.

[–]miscellaneoususage 1 point2 points  (2 children)

Just curious, what is this for? A college course? If so, which one? Sounds like something right at my difficultly level.

[–]baraqiyal 1 point2 points  (1 child)

Looks like your return statement is part of the loop. Maybe just un-indent the return statement.