Created
August 16, 2018 01:36
-
-
Save acwoss/8f4a29606036cd7f6e1d3f315269d0fb to your computer and use it in GitHub Desktop.
TrustyDistortedExecutable created by acwoss - https://repl.it/@acwoss/TrustyDistortedExecutable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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