import math def isPrime(num): if num==5 or num==7: return True elif num%5==0 and num%7==0: return False else: for n in range(3,int(math.sqrt(num))+1): if num%n==0: return False return True