This repository has been archived on 2022-05-03. You can view files and clone it, but cannot push or open issues/pull-requests.
PR3Python/python/s1/s1_a51.py

19 lines
431 B
Python

import numpy as np
a=np.array([[3,0,-2,11],[0,0,9,0],[0,7,0,0],[0,0,0,-3]])
print(a)
my_list = [[], [], [], []]
MAX_LENGTH = 4
for i in range(0, MAX_LENGTH):
for j in range(0, MAX_LENGTH):
n = int(input("Enter n:"))
my_list[i].insert(j, n)
print(my_list)
print()
for i, row in enumerate(my_list):
for j, item in enumerate(row):
print(f'a[{i}] [{j}] = {item} ', end=' ')
print()