calculate the variables of a linear system n x n

Asked

Viewed 64 times

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)
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.