remove_duplicates: Conditions on input!


Hi there! I just wrote the function for remove_duplicates. Now, the function works fine, my question to you is: how would I tell the function to accept only lists? (Or for that matter, only integers, only strings etc.)?

If you want to take a loot at how I wrote it, here it is:

def remove_duplicates(m):
    for x in m:
        if x not in n:
    return n


You may use type()


def remove_duplicates(m):
    if type(m) == list:
        #your code