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'))
Please click on the like button if it worked

Solution not working or have any suggestions? Please send an email to [email protected]

donate a cup of tea :)

Join Our Facebook Group

Share this solution


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