- Code: Select all

# Prime Number Checker by Alex "Arrexel" Reid

print "Prime Number Checker"

primenum = float(raw_input("Enter the number to check: "))

if primenum % 2 == 0:

primehalf = primenum / 2

elif primenum % 2 != 0:

primehalf = primenum / 2 + 0.5

primehalf = long(primehalf)

divisor = 2

prime = True

for x in range(primehalf):

if primenum % divisor == 0:

print int(primenum), "is not a prime number."

prime = False

break

divisor += 1

if prime != False:

print int(primenum), "is a prime number."

Add suggestions/improvements/comments.

-Arr