I've made different codes and always get "Oops, try again. Your function fails on is_prime(3). It returns None when it should return True."

I've seen other solutions here but using some elements I don't understand.

```
def is_prime(x):
if x < 2:
return False
elif x == 2:
return True
else:
for n in range(2, x-1):
print x
print x / n
temp = x / n
if type(temp) == int:
return False
else:
return True
```

I also tried a different code like this but once more, no results.

```
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
else:
return True
```

But in this case I get another error: "Oops, try again. Your function fails on is_prime(9). It returns True when it should return False."

I'm stuck here...