ich habe die folgende Liste:
Code: Alles auswählen
[[0, 'ABC', 'DEF', 'GHI'], [0, '11', '12', '13'], [0, '21', '22', '23'], [0, '31', '32', '33'], [0, '41', '42', '43'], [0, '51', '52', '53']]Also so
Code: Alles auswählen
0 ABC DEF GHI
0 11 12 13
0 21 22 23Nun habe ich folgende Ausgabe versucht:
Code: Alles auswählen
fm = ("{0:>3}{1:>6}{2:>6}{3:>6}")
print("{0:>3}{1:>6}{2:>6}{3:>6}".format("",x01,x02,x03))
for d3 in range(0,6):
for d4 in range(0,4):
print(fm.format(table[d3][d4]))#Fehler!!!
print(table[d3][d4]) # Funktioniert
Code: Alles auswählen
Traceback (most recent call last):
File "passwordmatrix.py", line 33, in <module>
print(fm.format(table[d3][d4]))
IndexError: tuple index out of rangeVG niesel
