-2
A = [
    [1, 2],
    [4, 6],
    [3, 9]
]

print("\nHasil dari B= ")
for i in range(3):
    for j in range(2):
        B=2*A[i][j]
        print(B, end="  ")
     print("")   

output:
2  4
8  12
6  18

How to transpose from 3x2 to 2x3 matrix, from existing output results

Seyn
  • 1

1 Answers1

0

For handling such arrays, consider using numpy. It provides all such operations for the matrix. Otherwise you would have to have a new array with the size of 2x3 and copy value by value.