Skip to content

Instantly share code, notes, and snippets.



Created Aug 16, 2018
What would you like to do?
TrustyDistortedExecutable created by acwoss -
import numpy
dimensions = input('Dimensões da matriz NxM: ').split()
N, M = [int(value) for value in dimensions]
matrix = []
for i in range(N):
row = input(f'Linha {i+1}: ').split()
if len(row) != M:
raise Exception(f'Você precisa informar {M} valores por linha')
numbers = [int(number) for number in row]
matrix = numpy.matrix(matrix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment