
, braucht kein mensch, aber bin grad im krankenstand, da hat man allerlei unsinn im kopf:
Code: Alles auswählen
class ListigeListenAusgabe:
def __init__(self, my_lists):
self.my_lists=my_lists
def ausgabe(self):
for i in range(len(self.my_lists)):
try:
if self.my_lists[i+1] in self.my_lists:
print str(self.my_lists[i]),'\n'
except IndexError:
print str(self.my_lists[i])
erfolgreiche tests!
Code: Alles auswählen
>>> g=ListigeListenAusgabe(([1,2,3],[4,5,6],[7,8,9]))
>>> g.ausgabe()
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
>>> a=ListigeListenAusgabe(([1,2,3],[4,5,6],[7,8,9],[10,11,12]))
>>> a.ausgabe()
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
[10, 11, 12]
>>>