I'm using this function to get the prime factors of the a number. The current output is printing each prime factor. I'm trying to understand the workings of this code, and I don't understand how the `while` loop is working.

```
def get_primes(n):
    for i in range(2, n + 1):
        while n % i == 0:
            n = n / i
            print(i)

print(get_primes(32))

```

The output is the correct answer, `2 2 2 2 2`. But I don't understand how `2` is the only value of `i` where `n % i == 0`.