Here is my code:
def isEven(number):
return number % 2 == 0
def run(x):
z = x
while z != 1:
if isEven(z) == True:
z = z/2
print z
else:
z = (3*z)+1
print z
else:
print 'Got one!'
#To see if the collatz does indeed always work
x+=1
It works up until 999, at which it continues indefinitely, print Got one! 999
, eventually raising a Segmentation Fault: 22
. How do I fix this?