https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/0/6?curriculum_id=4f89dab3d788890003000096#

Oops, try again. Your function fails on is_prime(9). It returns True when it should return False.

I can't figure this one out. I thought that x % n == 0 could handle is_prime(9). I was reading other people's questions about this exercise, and the moderators talked about how a function ends when a return keyword is reached. How can I fix mine so that this doesn't happen?

```
def is_prime(x):
if x < 2:
return False
elif x == 2:
return True
else:
for n in range(2, x):
if x % n == 0:
return False
elif x % n != 0:
return True
```