Trying to make sure I understand how range works, and looking for clarification.

In the code for the solution it shows a line as for n in range (2,x-1).

““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””

I’m wondering how the value for n is found. Say I input an 8. Does this line of the code go through numbers from 8 to 2 in order to see if 8 can be divided evenly for the next line of code?