Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to Take Matrix input from user in Python

matrix = []
n = int(input("Enter the number of row = "))
for i in range(n):
    row = []
    print("Enter the all values of -", (i+1), "no. row with enter", end='')
    for j in range(n):
        row.append(int(input()))
    matrix.append(row)
print(matrix)
 
PREVIOUS NEXT
Tagged: #Take #Matrix #input #user #Python
ADD COMMENT
Topic
Name
7+8 =