Is_prime why x-1?


Why is it necessary to create a range(2, x-1).... Isn't the the first parameter in range inclusive, while the second parameter is exclusive? Since the second parameter is exclusive, doesn't that mean that the list created will always be one short of the number entered into the second parameter?

for n in range(2, x-1):
            if x%n == 0:
                return False


doesn't it work with for n in range(2,x)? It should work, because like you said, it is exclusive the second parameter