Q:

For loop iteration seemingly skips two numbers in the list

When running the code below, I can't understand why it doesn't remove all 1's? It keeps two of them and with my two print statements added before the if statement, it shows the program seemingly skipping over the last 2 of the 4 1's. I know of an easier way to do this, I'm just trying to understand the logic of why this isn't working.
numbers3 = [1, 1, 1, 1, 4, 5, 7, 7, 9]
print(numbers3.count(1))

for number in numbers3:
    print(numbers3.count(number))
    print(number)
    if numbers3.count(number) > 1:
        numbers3.remove(number)
print(numbers3)

I expect the out put to be [1, 4, 5, 7, 9]
But instead I get [1, 1, 4, 5, 7, 9]

A:

Welcome to Stackoverflow.
The problem is that you are modifying the list you are iterating over, which is rarely a recipe for a happy result in Python (or most other languages).
It's fairly common to see questions from beginners that usefully tell us what the expected output is, but not why. Reading your code, I deduce (or rather guess) that you would like a list containing a single copy of each unique number.
One way to achieve your end is to build a separate list of the numbers you want. So this (untested) should work:
result = []
for number in numbers3:
    if number not in result:
        result.append(number)

A simpler way, which since Python 3.6 should retain ordering, would be
result = list(set(numbers3))

