index nested lists

Alex magobin at gmail.com
Tue Jul 28 14:50:35 CEST 2009


hi at all,
 If I have this list:

>>> lista
['ciao', 1, ['mela', 'pera', 'banana'], [1, 2, 3]]

if I want enumerate elements...I can see:

>>> for parola in lista:
	print lista[i]
	i = i + 1

ciao
1
['mela', 'pera', 'banana']
[1, 2, 3]
>>>

but, if I want to enumerate elements about nested lists ??, something
like:

ciao
1
mela
pera
banana
1
2
3

...How can I do ??

Alex



More information about the Python-list mailing list