#sample solution
def is_prime(x):
x = int(x)
if x < 2:
return False
else:
i = 2
while i < x:
print "dividing "+str(x)+" by "+str(i)
if x % i == 0:
return False
else:
i = i + 1
return True
def is_prime(x):
x = int(x)
if x < 2:
return False
else:
i = 2
while i < x:
print "dividing "+str(x)+" by "+str(i)
if x % i == 0:
return False
else:
i = i + 1
return True
No comments:
Post a Comment