0
Develop a Python program to calculate the variables of a linear system n x n . System dimensions must be provided by the user, as well as the values of matrices A and B.
So far I’ve only been able to insert this
import numpy as np
lista1 = []
linha1 = []
nc = int(input('Quantas colunas? '))
nl = int(input('Quantas linhas? '))
for c1 in range(0, nl):
linha1 = []
for c2 in range(0, nc):
n = int(input('Número L[{0}] C[{1}]: '.format(c1 + 1,c2 + 1)))
linha1.append(n)
lista1.append(linha1)
print(lista1)
lista2 = []
linha2 = []
nc = int(input('Quantas colunas? '))
nl = int(input('Quantas linhas? '))
for c1 in range(0, nl):
linha2 = []
for c2 in range(0, nc):
n = int(input('Número L[{0}] C[{1}]: '.format(c1 + 1,c2 + 1)))
linha2.append(n)
lista2.append(linha2)
print(lista2)
You may or may not use
numpy
?!– Lacobus
Strongly linked: It is possible to declare Unknown in Python to calculate constants of a Mathematical function?
– Woss
if it is nxn vc can take a call from the input, and only input ('between x')', you can use Random to generate the numbers better than entering one by one
– Elton Nunes