21 lines
494 B
Python
21 lines
494 B
Python
#5.1
|
|
#a)
|
|
matrix_list = [[3, 0, -2, 11], [0, 0, 9, 0], [0, 7, 0, 0], [0, 0, 0, -3]]
|
|
print(matrix_list)
|
|
|
|
#b+c)
|
|
matrix_list_general = [[], [], [], []]
|
|
MAX = 4
|
|
for i in range(0, MAX):
|
|
print("Zeile " + str(i + 1))
|
|
for j in range(0, MAX):
|
|
n = int(input("Value:"))
|
|
matrix_list_general[i].insert(j, n)
|
|
|
|
print(matrix_list_general)
|
|
|
|
#d)
|
|
for i, row in enumerate(matrix_list_general):
|
|
for j, value in enumerate(row):
|
|
print(f'a[{i}][{j}] = {value} ')
|