When I run the following code:
number = input("Please Input Number...")
def prime_checker(divisor):
line = str(number) + " divided by " + str(divisor) + " = " + str(number/divisor)
if number == divisor:
print "This number is prime"
elif number % divisor == 0:
print line
else:
print "This number is not divisible by " + str(divisor)
next_number = divisor + 1
prime checker(next_number)
prime_checker(2)
I receive "RuntimeError: maximum recursion depth exceeded while getting the str of an object". I am trying to build a program which will check all the numbers under the inputted number to see if the inputted number is prime. If the number is divisible by anything, the program will give the division sentence. However, when the program checks to see if the inputted number is divisible by 999, the program starts doing the following:
Is there any way to fix this? Or is that the maximum value I can check?