HackerRank- Python Eye and Identity
print an array of size NXM with its main diagonal elements as 0's and 1's everywhere else.
- import numpy
- print(str(numpy.eye(*map(int,input().split()))).replace('1',' 1').replace('0',' 0'))
print an array of size NXM with its main diagonal elements as 0's and 1's everywhere else.
- import numpy
- print(str(numpy.eye(*map(int,input().split()))).replace('1',' 1').replace('0',' 0'))
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.