Skip to content

Instantly share code, notes, and snippets.

@acwoss

acwoss/main.py

Created Aug 16, 2018
Embed
What would you like to do?
TrustyDistortedExecutable created by acwoss - https://repl.it/@acwoss/TrustyDistortedExecutable
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.append(numbers)
matrix = numpy.matrix(matrix)
print(matrix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment