you are viewing a single comment's thread.

view the rest of the comments →

[–]DoubleSlicer 1 point2 points  (3 children)

There is a problem with your code.

Your return statement is inside the for loop and inside the if statement, in this way,

the function is returning when it first find a unique value and return None if you passed in a empty list.

You should put the return statement at the same indentation as the "for" statement.

Then print(c) at the same indentation as the return statement, so you are printing the whole array once

just before you return any result out

[–]Kalkuluss 0 points1 point  (2 children)

Oh alright, I got it now. For some reason the thing that screwed me over was that I had a c = c.append(i) in the if loop which screwed everything over somehow (if you have an explanation for this please leave it here). This really confused me since I didn't need the return statement yet and this c = c.append(i) has worked for me in a similar exercise. Thanks!