import numpy as np
def matrix(m,n):
list1 = []
list2 = []
for i in range(m*n):
inputs = int(input('Enter numbers on intended matrix here: '))
list1.append(inputs)
for i in range(m*n):
order_input = min(list1)
list1.remove(order_input)
list2.append(order_input)
matrix1 = np.array(list2)
matrix2 = matrix1.reshape(m,n)
print(matrix2)
matrix(2,3)
import numpy as np
def matrix(m,n):
list1 = []
list2 = []
for i in range(m*n):
inputs = int(input('Enter numbers on intended matrix here: '))
list1.append(inputs)
for i in range(m*n):
order_input = min(list1)
list1.remove(order_input)
list2.append(order_input)
matrix1 = np.array(list2)
matrix2 = matrix1.reshape(m,n)
print(matrix2)
matrix(2,3)
Comments
Leave a comment