I have no idea what's wrong with my code

https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/6?curriculum_id=4f89dab3d788890003000096

It does not return true for is_prime(2)

```
x=int(input("Please enter an integer to see if it's prime:\n"))
def is_prime(x):
if x<2:
return False
for n in range(2, x):
if x % n == 0:
return False
elif x==n:
return True
print(is_prime(x))
```