feld = [[0,1,1], [2,1,2], [0,2,2]] def ascii(f): symbols = [" ", "O", "X"] res = "" for y in range(3): for x in range(3): res += " "+symbols[feld[x][y]]+" " if (x<2): res += "|" res += "\n" if (y<2): res += "---+---+---\n" return res print(ascii(feld))