You are viewing a single comment's thread. Return to all comments →
Your task is to print an array of size X with its main diagonal elements as 's and 's everywhere else.
Note
In order to get alignment correct, please insert the line below the numpy import.
Input Format
A single line containing the space separated values of and . denotes the rows. denotes the columns.
Output Format
Print the desired X array.
Sample Input
3 3 Sample Output
[[ 1. 0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]]
Seems like cookies are disabled on this browser, please enable them to open this website
Eye and Identity
You are viewing a single comment's thread. Return to all comments →
Your task is to print an array of size X with its main diagonal elements as 's and 's everywhere else.
Note
In order to get alignment correct, please insert the line below the numpy import.
Input Format
A single line containing the space separated values of and . denotes the rows. denotes the columns.
Output Format
Print the desired X array.
Sample Input
3 3 Sample Output
[[ 1. 0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]]