Remove Duplicates


I'm getting this error message:
Oops, try again. remove_duplicates([]) resulted in an error: list index out of range

With the following code:
def remove_duplicates(zz):
new = []
for i in range(len(zz)):

    if zz[i] not in new:

return new

I don't know how that is an error, as this code works on other shells. I don't think that the range of len(zz) should possibly give me an error... and I'm not modifying the list 'zz' at all.

Please help?

Replace this line with your code.


The above line will raise an error if the inputs are an empty list, as indicated by the error message.

if not len(zz) return []
new = []
for x in zz: