In brief, your isprime(x) checks whether the number is odd, exiting right after if x % 2 == 0.
Try a small change so that you would actually iterate:
def isprime(x):
for i in range(2, x-1):
if x % i == 0:
return False
else:
return True
Note that else: is now part of the for loop rather than if statement.