Hi

I have completed the exercise with the code below which I came up with. It is the result of some experimentation but I understand it. However looking on the forum some of the code people come up with look so short!

Is there anything I am doing which could be done more efficiently?

Thanks

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