Can I make a Nested Recursion in python?
Current Code:
def recur(n):
if n>12:
return
#actions
Dev.step(n)
Dev.turnRight()
#recursion
recur(n+2)
recur(2)
I'm new to python. Is 开发者_开发知识库there any possibilites to make a nested recursion. I want to make like nested for loop but, I use recursion function.
n=10 def test(n): if n<=0: return 1 else: return test(test(n-1)+1) print test(n
Certainly your question is not clear to anyone. Also from your code i am not able understand what is Dev.step(n) & Dev.turnRight() is it a method or class function you are calling. please give that code as well in the description.
精彩评论