walking a list

Jeff Epler jepler at unpythonic.net
Fri Apr 23 20:21:43 CEST 2004


def print_or_recurse(l):
    for i in l:
        if isinstance(i, list): print_or_recurse(i)
        else: print i

print_or_recurse([1,2,[3,2],5,[6,5,4]])

Jeff




More information about the Python-list mailing list