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

and if i write the else outside the loop it says local n after assignment something like that when i make if elif inside the loop it gives error on is_prime returns true

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

this another code i made

error:

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