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

I don't understand how the code is working for 2? 2 is divisible by both 2 and 1. so x%n is equal to zero in both cases. That should return False, but it is returning True

The code is working. And I know 2 is a prime number. I am just trying to figure out, how it is working for 2?

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