Feb-22-2022, 06:56 PM
One reason for not using one and two letter variable names is that things like
mat
can be confusing. Descriptive variable names make the code much clearer and easier to work with and understand.M = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]] def column (matrix, column_number) : output_column = [] for row in matrix : output_column.append (row [column_number]) return output_column print (column (M, 1))