Ad
Code
Diff
  • def prime(x):
        if x <= 1:
            return False
        for i in range(2,int(x/2)):
            if x % i is 0:
                return False
        return True
    • def prime(x):
    • counter = 0
    • for i in range(1,x):
    • if x <= 1:
    • return False
    • for i in range(2,int(x/2)):
    • if x % i is 0:
    • counter += 1
    • if counter is 0:
    • return True
    • else:
    • return False
    • return False
    • return True