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'))




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube