I assume your column and rows are just a list of lists?
So you have the following?
L = [[1,2,3], [4,5,6]]
To add another line, use the add list method.
L.append([7,8,9])
gives
L = [[1,2,3], [4,5,6], [7,8,9]]
To add another column, you have to iterate over each row. An easy way to do this is with a list comprehension.
L = [x + [0] for x in L]
gives
L = [[1,2,3,0], [4,5,6,0]]
Stefan kendall
source share