remove_duplicates


#1

It work's, but is there any simple way to create the copy of list?

def remove_duplicates(x):
    #creating the copy of x
    y = [i for i in x if x.count(i) != 0]
    #remove duplicates
    for i in y:
        while y.count(i) != 1:
            y.remove(i)
    return y    
    

print remove_duplicates([1, 1, 1, 1, 3, 3, 3, 4])

#2

yea, use the list function:
`
y = list(x)