Is_prime function


#1

for the range loop in Python, e.g. range(0,x)
wont the numbers included be: 0,1,2,3…,x-1? i.e. not inclusiveof the end point
then how come in this example, the range is range(2,x-1)?? shouldnt it just be (2,x)?

https://www.codecademy.com/courses/learn-python/lessons/practice-makes-perfect/exercises/isprime?action=resume_content_item


#2

it can be, and i think it should be. range does not include its stop value, but many people fail to realize this, so they do x-1 like they see in the instructions. Good that you caught it, it means you think about what you are doing :slight_smile: