I get the following error - Your function fails on is_prime(-7). It returns True when it should return False. Can someone please help?

def is_prime(x):

#no other number goes in except 1 and number itself

x = abs(x)

if x < 2:

return False

if x == 2:

return True

for n in range(2, x):

if x % n == 0:

return False

else:

return True