| Python 2.2 für Einsteiger | ||
|---|---|---|
| <<< Previous | Einführung anhand von Beispielen | Next >>> |
>>> list1 = ['a', 'b']
>>> list2 = ['1', ['a', 'b'], '2']
>>> import types
>>> def visitEachListElementOf(alist):
for el in alist:
if isinstance(el, types.ListType):
visitEachListElementOf(el)
else:
print el # do whatever is necessary with the list element
>>> visitEachElelementOf(list2)
1
a
b
2
| <<< Previous | Home | Next >>> |
| Betrieve Datenbank auslesen | Up | Link - Extraktor in Homepage |