import math, sys, time while True: print('Enter a number that you want to check if it is prime.') number = eval(input()) try: if number == 1: print('That number is not prime because mathematicians say so') elif number % 2 != 0: nnumber = int(round(number / 2 , 0)) for i in range(3, nnumber + 1): if number % i == 0: prime = 0 print('That number is not a prime number because it is divisible by ' + str(i) + '.') break elif number % i != 0 and i == nnumber: print('That number is a prime number') elif number == 2: print('That number is a prime number') else: print('That number is not a prime number because it is divisible by 2') except OverflowError: for i in range(2, number): if number % i != 0: prime = 1 continue else: prime = 0 print('That is not a prime number becuase it is divisible by ' + str(i) + '.') break if prime == 1: print('That number is a prime number.')