matrix = [[a, a, a + 1],
[a, a + 1, a + 2],
[a + 1, a + 2, a + 2]]
for line in range(0, len(matrix)):
string = ''
for item in range(0, len(matrix)):
string = '%s %s' % (string, matrix[item][line])
print(string)
matrix = [[a, a, a + 1],
[a, a + 1, a + 2],
[a + 1, a + 2, a + 2]]
for line in range(0, len(matrix)):
string = ''
for item in range(0, len(matrix)):
string = '%s %s' % (string, matrix[item][line])
print(string)