![]() |
Retaining the contents of a list during a recursive function
:
def find_all_items(site):How do i keep the value of all_items that i have within the first function call and return a list of all the items at once also from the second function call Now the list is being overwritten |
Is this a tutorial or a question? It doesn't seem to say, anywhere.
|
It never fails to amaze me how so many of the newcomers to this forum have such unbelievably bad (written) communication skills.
|
:
def find_all_items(site):Perhaps: :
def find_all_items(site): |
I tried both the examples the issue is that the list all_items is cleared when the function is called again!
|
Hm. It might help if you showed all your code, as it's difficult to understand exactly what you're asking for. Do you want some sort of persistence? Then you either need a functor:
:
:
:
:
|
| All times are GMT -5. The time now is 9:17 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC