This is my code:

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

When I run this code it brings up the following error:

Your function fails on is_prime(2). It returns None when it should return True.

I have fiddled with the code for a while now and it doesn't seem to work at all. Can anyone help?