{"id":19479,"date":"2021-08-30T16:06:32","date_gmt":"2021-08-30T10:36:32","guid":{"rendered":"https:\/\/python-programs.com\/?p=19479"},"modified":"2021-11-22T18:36:30","modified_gmt":"2021-11-22T13:06:30","slug":"python-program-to-read-and-display-a-matrix","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-read-and-display-a-matrix\/","title":{"rendered":"Python Program to Read and Display a Matrix"},"content":{"rendered":"

In the previous article, we have discussed Python Program to find the Sum of Series 1^1+2^2+3^3…+N^N<\/a>
\nGiven a matrix, the task is to scan and print the elements of the given matrix in Python<\/p>\n

What is a matrix:<\/strong><\/p>\n

A matrix is a rectangular sequence of numbers divided into columns and rows. A matrix element or entry is a number that appears in a matrix.<\/p>\n

Example:<\/strong><\/p>\n

\"\"<\/p>\n

Above is the matrix which contains 5 rows and 4 columns and having elements from 1 to 20.<\/p>\n

In this order, the dimensions of a matrix indicate the number of rows and columns.<\/p>\n

Here as there are 5 rows and 4 columns it is called a 5*4 matrix.<\/p>\n

Program to Read and Display a Matrix in Python<\/h2>\n

Below are the ways to read and display the elements of the given matrix in Python:<\/p>\n