@teraplayer26854

To expand on what @ionatan is saying,

What you have going on is

Ok let's start with what a prime number is.

A prime number is a whole number greater than 1, whose only two whole-number factors are 1 and itself. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29.

**SOURCE:**Definition Source

Now how do we get a whole number in a program then, how do we transfer what we know to this?

**Steps:**

- A number greater than 1
- Is the number only divisible by it's self and one?

Ok, now that we have the rules lets compare them to your program.

`if x < 2: return False`

Looks good, if a number is less than 2 it's False.

Next,

`elif x == 2: return True`

Nice, we know 2 is a prime

Now,

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

So if a number is divisible by anything between 2 and it's self -1 it is not a prime, looks good.

Ok, let's test some stuffz, let's add a line to your code to see what's happening!

```
# Right after this line add the print statement
for n in range(2, x):
print("%s" % (x % n))
```

After you run that you will see your issue. It does only one number and because you have it immediately escaping with the `else: return`

it will always return a number is prime.

Now here is an example of some code I have written, while it is a little verbose it should tell you what needs to be done and why all in the code it's self. If you don't get why something was done ask.

```
def is_prime(get_number, display=True):
prime = True
_numbers_to_number = [number for number in range(2, get_number)]
for number in _numbers_to_number:
if get_number % number == 0:
prime = False
break
if prime:
if display:
print("%s is a prime" % prime)
return get_number
elif not prime:
if display:
print("%s is not a Prime" % get_number)
```