Please help, im stuck here for too long


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/4?curriculum_id=4f89dab3d788890003000096#

error: list out of range

I do whatever the hint told me and the result was right. I don't know what is wrong here

def count(x, j):
    for i in x:
        if i == j:
            return True
    else:
        return False

def remove_duplicates(x):
    z = [x[0]]
    for i in range(1, len(x)):
        if count(z, x[i]) == False:
            z.append(x[i])
    return z
    
print remove_duplicates([1, 2, 2, 4, 5, 5, 4]).


#2

There is simpler solution to this. Declare empty list z = [], iterate over x and if item is not in z just append it to your empty list z