The following code is what Codecademy supplied when I gave up and selected “Get code.” I understand it except **why is the last number in the range set to x-1, rather than simply x, given that range already excludes the last number?** It runs correctly. Is it a mistake?

```
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
```