Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main() :
- row = int(input("Enter the number of rows in the matrix : "))
- col = int(input("Enter the number of column in the matrix : "))
- M1 , T_mat = [],[]
- for j in range(row) :
- temp = []
- for k in range(col) :
- elem = eval(input("Enter the Element of the Matrix at the Position ; Row : {} , Column : {} =====> ".format(j+1,k+1)))
- temp.append(elem)
- M1.append(temp)
- print("\nMatrix A : ")
- for i in M1 :
- for j in i :
- print(j , end = " ")
- print()
- for i in range(col) :
- temp = []
- for j in range(row) :
- temp.append(M1[j][i])
- T_mat.append(temp)
- print("\nTranspose Of the Matrix A : ")
- for i in T_mat :
- for j in i :
- print(j , end = " ")
- print()
- main()
Add Comment
Please, Sign In to add comment