xxxxxxxxxx
matrix = [[0 for column in range(3)]for row in range(3)]
# Generates a 3x3 bidimensional array
xxxxxxxxxx
# First, let's define the dimensions of the matrix
rows = 3
cols = 4
# Initialize an empty matrix
matrix = []
# Populate the matrix with values
for i in range(rows):
row = []
for j in range(cols):
value = int(input(f"Enter element for row {i+1}, column {j+1}: "))
row.append(value)
matrix.append(row)
# Print the matrix
for row in matrix:
print(row)