def recursive_lambda(func):
def ret(*args):
return func(ret, *args)
return ret
print(recursive_lambda(lambda factorial, x: x * factorial(x - 1) if x > 1 else 1)(6)) # 720
ZGVmIHJlY3Vyc2l2ZV9sYW1iZGEoZnVuYyk6CiAgICBkZWYgcmV0KCphcmdzKToKICAgICAgICByZXR1cm4gZnVuYyhyZXQsICphcmdzKQogICAgcmV0dXJuIHJldAoKcHJpbnQocmVjdXJzaXZlX2xhbWJkYShsYW1iZGEgZmFjdG9yaWFsLCB4OiB4ICogZmFjdG9yaWFsKHggLSAxKSBpZiB4ID4gMSBlbHNlIDEpKDYpKSAgIyA3MjA=