The following is my code for is_prime, but I do not know where my error is.

When is_prime(9), the output is True instead of False

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