Skip to main content

Posts

Featured

Python practice problem

  Given a matrix M write a function Transpose which accepts a matrix M and return the transpose of M. Transpose of a matrix is a matrix in which each row is changed to a column or vice versa. Input  A matrix M [[1,2,3],[4,5,6],[7,8,9]] Output Transpose of M [[1,4,7],[2,5,8],[3,6,9]] SOLUTION: #Transverse of a matrix #Creating a function trans that will return the transpose of the matrix when the given matrix is passed as an argument def trans(M,n):          '''     M=Matrix     n=order of the matrix     '''          Trans_mat=[] #Creating a new matrix in which we will be storing the transpose of the matrix value     #Creating the trans_mat a null matrix so that we can replace the values and put the transposed values in there          for i in range(n):         l=[]         for j in range(n):         ...

Latest Posts

Python practice problem

Sorting of array in JavaScript using the sort functionality

Compare two strings in C using strcmp

C programme to automate the tower of hanoi problem

Convert Decimal to binary using C

Practice problems for C programming language

Insert an element in an array using C

Search an element from an given array using C

Use pointers to replace the value of two variables

Write a menu driven C programe which will create the reverse of the array will get you the maximum value from the array and also get the sum of the elements from the array