On Dec 10, 2:25 pm, eric <[EMAIL PROTECTED]> wrote: > On Dec 10, 9:16 pm, JD <[EMAIL PROTECTED]> wrote: > > > > > I got a iterated function like this: > > > def iterSomething(list): > > has_something = False > > for cell in list: > > if something in cell: > > has_something = True > > output = something > > if has_something: > > iterSomething(output) > > else: > > final_out = outupt > > > The problem is how can I read this final_out outside of the function. > > I tried the global statement, it seems not work. Any idea? > > > JD Thanks,
I tried to return the last result. It's not working. Your code works, thanks > why don't you just return it ? > > def iterSomething(list): > has_something = False > for cell in list: > if something in cell: > has_something = True > output = something > if has_something: > return iterSomething(output) > else: > return output > > ? -- http://mail.python.org/mailman/listinfo/python-list