Python program to print an identity matrix

By: Editorial Staff | Last Updated: | In: Python Tutorial


Today we are going to share a Python program to print an identity matrix. If you are a python beginner and want to start learning the python programming, then keep your close attention in this tutorial as I am going to share a Python program to print an identity matrix.

Python program to print an identity matrix code

python program and execute it with the help of python compiler.

Program Output:

Enter a number: 5
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1


About: Editorial Staff

Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari