parse list recurisively

Chris Angelico rosuav at gmail.com
Mon Sep 23 09:00:06 EDT 2013


On Mon, Sep 23, 2013 at 10:53 PM,  <andypu at zoho.com> wrote:
> Hello,
>
> i use a load of lists and often i dont know how deep it is, how can i parse that lists elegantly (without a bunch of for loops)

You can write a function that calls itself - that's what "recursive"
usually means in programming. Start with the tutorial on functions, or
just search the web for 'python recursive function'. Once you have a
bit of code down, you'll be able to ask a more specific question.

Have fun!

ChrisA



More information about the Python-list mailing list