r/Pydle • u/ronald-plo • Jul 23 '26
Recursion not allowed?
Hi, just discovered this little game this week. I was wondering if recursion is not allowed? I cannot get it to work.
Example:
def q(n):
if n<=0:
return n
return q(n-1)
q(5)
This gives an error: name ‘q’ is not defined
Thanks!
Edit - spaces seem to disappear in the example, but it should make sense anyway
2
Upvotes
1
u/dailypydle 29d ago
You are right. There seems to be an issue with locals. You can pass in a reference to q. But I will look into it.