HackerRank- Python Eye and Identity


print an array of size NXM with its main diagonal elements as 0's and 1's everywhere else.

  1. import numpy
  2. print(str(numpy.eye(*map(int,input().split()))).replace('1',' 1').replace('0',' 0'))

download android app