Recursion function not working properly

后端 未结 4 597
一向
一向 2020-12-07 06:08

I\'m having quite a hard time figuring out what\'s going wrong here:

class iterate():
    def __init__(self):
        self.length=1
    def iterated(self, n)         


        
4条回答
  •  温柔的废话
    2020-12-07 06:29

    You should finish each elif branch with return self.iterated(...) rather than just self.iterated(...)

提交回复
热议问题