An error with list.remove()

I wrote this bit of code to remove duplicate numbers in a list, but it doesn’t want to remove the extra copy of the number one for some reason. I also tried removing the entire list and just putting two ones and it worked like it was supposed to. Could someone explain why this happened?