def remove_duplicates(lists): new = lists for n in range(1, len(lists)): if lists[n] not in new: new.append(lists[n]) return new
I know the right code, just cannot find anything wrong with my old codes above:
It returns the error below, wondering can anyone help me figure out what's wrong with my code above? Thanks!
Oops, try again. remove_duplicates([4, 5, 5, 4]) resulted in an error: argument of type 'int' is not iterable