Hey all, I just finished the is_prime program in section 15, where you need to make a program to identify if a number is prime or not. I came up with a code that I could find no problem with, but it still wasn't working, and it only worked after changing the indentation and else clause of the last lines. So I'm just wondering why the original code doesn't work with what I had?

Original Code: Doesn't work

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

Revised Code: Works!

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

To me, it looks like they should behave the same way.

Thanks!