I want to caculate an church number by python below,but it prompt the errors when I use the input greater than 993,anyone whom had the experience told me what happend?
NUM0=lambda f: lambda x:x
SUCC=lambda n: lambda f: lambda x: f(n(f)(x))
def decoding(n):
num=NUM0
for i in xrange(n):
num = SUCC(num)
return num
def encoding(num):
f=lambda x:x+1
return str(num(f)(0))
print encoding(decoding(994)) # Why fails once greater than 993