What is mutability and why does it matter – Solution [0]

This is the way how to do it

table = create_blank_table(10, 10)
table[1][3] = "X"
table[4][4] = "O"
print_table(table)

But the result looks different than we expected

. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .
. . . X O . . . . .

You did the right thing, but the result looks wrong, doesn't it? What is going on?!

There is obviously an error. But where? Look at the function again and try to guess.

def create_blank_table(n_rows, n_columns, fill_character="."):
    row = [fill_character] * n_columns
    table = []
    for _ in range(n_rows):
        table.append(row)
    return table