In this HackerRank Eye and Identity problem solution Your task is to print an array of size N X M with its main diagonal elements as 1's and 0's everywhere else.

HackerRank Eye and Identity in python problem solution

HackerRank Eye and Identity in python problem solution

import numpy

N,M = list(int(x) for x in input().split())

print(numpy.eye(N,M))