```
matrix = []
for index, value in enumerate(['A','C','G','T']):
    matrix.append([])
    matrix[index].append(value + ':')
    for i in range(len(lines[0])):
        total = 0
        for sequence in lines:
            if sequence[i] == value:
               total += 1
        matrix[index].append(total)

unity = ''
for i in range(len(lines[0])):
  column = []
  for row in matrix:
    column.append(row[1:][i])
  maximum = column.index(max(column))
  unity += ['A', 'C', 'G', 'T'][maximum]
print("Unity: " + unity)

for row in matrix:
    print(' '.join(map(str, row)))

```

OUTPUT:

```
Unity: GGCTACGC
A: 1 2 0 2 3 2 0 0
C: 0 1 4 2 1 3 2 4
G: 3 3 2 0 1 2 4 1
T: 3 1 1 3 2 0 1 2

```

With this code I get this matrix but I want to form the matrix like this:

```
   A  C  G  T 
G: 1  0  3  3
G: 2  1  3  1
C: 0  4  2  1
T: 2  2  0  3
A: 3  1  1  2
C: 2  3  2  0
G: 0  2  4  1
C: 0  4  1  2

```

But I don't know how. I hope someone can help me. Thanks already for the answers.

The sequences are:   

AGCTACGT  

TAGCTAGC  

TAGCTACG  

GCTAGCGC  

TGCTAGCC  

GGCTACGT  

GTCACGTC