for i in A: print(' '.join(map(str, i)))
matrix = [["A", "B"], ["C", "D"]] print(' '.join([' '.join([str(cell) for cell in row]) for row in matrix]))
A B C D