递归

实例:

def d():
    return("123")
def c():
    r = d()
    return r
def b():
    r = c()
    return r
def a():
    r=b()
    print(r)
a()

 

 

def func(n):
    n += 1
    if n >= 2:
        return "end"
    return func(n)


ret = func(1)
print(ret)

 

posted @ 2016-11-21 11:45  橡皮头  阅读(152)  评论(0编辑  收藏  举报