is_prime - Practice Makes Perfect

It says that when checking 0 it fails.

I expect the program to run like it does in my Python GUI editor in sublime text 3. After I copy it into this web form it won't execute. What is off? I have checked other is_prime forums and the logic has similar semantics. Thanks.

In sublime the output for is_prime(9) is:

9 % 2 = 1 is Prime

9 % 3 = 0 is not Prime

9 % 4 = 1 is Prime

9 % 5 = 4 is Prime

9 % 6 = 3 is Prime

9 % 7 = 2 is Prime

9 % 8 = 1 is Prime

```
def is_prime(x):
for i in range(2, x, 1):
if x % i == 0 or i < 1:
print x, "%", i, "=", (x % i), "is not Prime"
return False
else:
print x, "%", i, "=", (x % i), "is Prime"
return True
is_prime(x)
```