Can someone tell me why this works

Can someone tell me why this works.

def remove_duplicates(ll):

new_list =

for m in ll:

if m not in new_list:

  new_list.append(m)

return new_list

print remove_duplicates([1, 2, 1])

If you don’t know why (or how) it works, then you must have another way of your own. Can you compare the two?