is_prime

A "list index out of range" error always appears when I run it with a number.

I tried print number[i] to see what number it is putting out but it always prints out numbers farther down the list than I expect so now I am stuck.

```
def is_prime(x):
n = 2
number = []
if x < 2:
return False
else:
while x > n:
number.append(n)
n = n + 1
print number
for i in number:
if x % number[i] == 0:
return False
else:
return True
```