a function ends the moment a return keyword is reached. Even while doing a loop (the loop just breaks)

if x is not divisible by any number between 2 and x (2 included, x excluded), the number is a prime number. Then you want to return True. So after the loop has finished running.

If x is divisible by a number between 2 and x return False is fine, since the number is not a prime number, it even stops the loop, so the rest of the loop doesn't have to execute (rather efficient)

So what you need to change is that True is returned after the loop. Currently True is returned in the first iteration of the loop if x / 2 doesn't have a remainder of zero