0
I created two M1 and M2 matrices and they have a dimension for seven elements. A third matrix called M3 has two dimensions where its first column must be formed by the elements of matrix MA and the second column by the elements of matrix B. Right after you need to display M3:
input:
02 04 06 08 10 12 14
02 04 06 08 10 12 14
Saída
02 02
04 04
06 06
08 08
10 10
12 12
14 14
Código:
M1 = input()
lista1 = M1.split()
M2 = input()
lista2 = M2.split()
MA = [lista1]
MB = [lista2]
print (MA)
print (MB)
Something like
M3 = [[a, b] for a, b in zip(M1, M2)]
?– Woss
It gave a result, only it’s not quite as expected
>>> [['1', '1'], [' ', ' '], ['2', '2'], [' ', ' '], ['3', '3'], [' ', ' '], ['4', '4'], [' ', ' '], ['5', '5'], [' ', ' '], ['6', '6'], [' ', ' '], ['7', '7']]
– Lucas Pimentel
Lucas, this happened because in your M1 and M2 code are not matrices of a dimension as described in the question. In the code, are
lista1
andlista2
.– Woss