Your is_prime() function will fail on 0,1 and all negative numbers.
suppose at 0..
When it starts looping then it will see range(2, -1).. which is an empty list,thus your loop will not able to go inside for loop and return
False instead it will run
else statement and return
instead of putting
x <= 1 (if statement inside of for loop) , create
if (initial of your function)statement that checks if x is less than or equal to 1 ,if it is then return