- Code: Select all
`def add_column(matrix):`

"""

>>> m = [[0, 0], [0, 0]]

>>> add_column(m)

[[0, 0, 0], [0, 0, 0]]

>>> n = [[3, 2], [5, 1], [4, 7]]

>>> add_column(n)

[[3, 2, 0], [5, 1, 0], [4, 7, 0]]

>>> n

[[3, 2], [5, 1], [4, 7]]

"""

new_matrix = matrix[:]

for i in new_matrix:

i += [0]

return new_matrix