why the code is right if only i write "return True" after if/else constraction, as bellow ?

```
def is_prime(x):
if x > 1:
for i in range(2,x):
if x%i==0:
return False
else:
return False
return True
```

but if i write other code, with "return True" in if/elif/else constaction (as bellow) - it doesn't work!

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

i just wont to try Python logic in my first code aboun last line "return True"

why it return False, in total ? if last line "return True"

```
>>>>return False
return True
```

for example, is_prime(9)