For anyone curious, when a function returns a value the function stops running. I didn't remember seeing this in previous lessons, but it appears very useful to know.

In this case, the first value in range(2,x-1) for x=9 is 2, so it checks if 9 % 2 == 0, which it does not since the remainder is 1 from the modulus operator, then runs the else condition to return True and breaks.

While it works to return a value of False when the function finds a factor and determines it cannot be prime ever past that point, when it tests each non-factor in the range it should not return True because then it will break on the first non-factor (in this case 2 for any odd number, which all prime numbers above 2 are) and give an incorrect result.