Python递归题目【多测师_王sir】

def f(x):
    if x == 0 or x == 1:
        return x
    else:
        x = f(x-2)-f(x-1)
    return x

print f(6)

 

posted @ 2020-08-04 09:41  多测师_王sir  阅读(163)  评论(0编辑  收藏  举报