I would like to know how to print an array [[2,3],
[4,6]]
for example, in the form of the bottom line without using
I would like to know how to print an array [[2,3],
[4,6]]
for example, in the form of the bottom line without using
First mode
matriz = ((2, 3), (4, 6))
for linha in matriz:
print(linha)
The result will be:
(2, 3)
(4, 6)
Second mode
matriz = ((2, 3), (4, 6))
for linha in matriz:
for coluna in linha:
print(coluna)
The result will be:
2
3
4
6
This will print formatted:
matriz = [[2, 3, 4], [5, 6, 7]]
for linha in matriz:
for coluna in linha:
print(coluna,end=' ')
print('\n')