resulting in ( , , , , ( , , , , ( , , , , ( , , , , ( , , , , ( , , , , ( , , , , ( , , , , ( , , , , transpose another useful operation that can be applied to matrix is the matrix transpose given matrixa transpose swaps the rows and columns to create new matrix of size as illustrated here implementing the matrix there are number of ways to organize the data for the matrix adtbut the most obvious is with the use of two-dimensional array or rectangular grid having defined and implemented the array adtwe can utilize it to implement the matrix adt as shown in listing listing the matrix py module implementation of the matrix adt using - array from array import array class matrix creates matrix of size numrows numcols initialized to def __init__selfnumrowsnumcols )self _thegrid array dnumrowsnumcols self _thegrid clear returns the number of rows in the matrix def numrowsself )return self _thegrid numrows(returns the number of columns in the matrix def numcolsself )return self _thegrid numcols(returns the value of element (ij) [ ,jdef __getitem__selfndxtuple )return self _thegridndxtuple[ ]ndxtuple[ sets the value of element ( ,jto the value sx[ ,js def __setitem__selfndxtuplescalar )self _thegridndxtuple[ ]ndxtuple[ scalar (listing continued