Is_prime why x-1?


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/6?curriculum_id=4f89dab3d788890003000096#

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


#2

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