1
Im Moment verwende ich den folgenden Code, um ein Array auszugeben, aber es kommt nicht gut für 2-stellige Zahlen ausgerichtet.Wie wird ein 2-D-Array, das dynamisch in einem Python-Code ausgewertet wird, als Tabelle ausgegeben?
for i in range(row):
for j in range(col):
print '{:2}'.format(Matrix[i][j]),
print
Ausgang:
0 M Y M I S S I S A H I P P I E I
I 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
M 1 .
I 2 . . . . .
S 3 . . .
S 4 . . .
M 5 .
I 6 . . . . .
S 7 . . .
S 8 . . .
I 9 . . . . .
S 10 . . .
S 11 . . .
I 12 . . . . .
P 13 . .
P 14 . .
I 15 . . . . .
die bestmögliche Art und Weise wäre es in einer Tabelle kommen haben – sagar0605