Hi, shablama.

Your code enters a loop because if the user enters an argument greater than 1, your while statement will loop forever.

Instead of creating a loop, why not just work with "if/elif/else" statements?

I've written the code below. It might just do the trick you're looking for:

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

However, I still don't completely know why this works and why the code below doesn't:

```
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
```

If anyone could shed light into that matter, I'd appreciate it.

Cheers.