Tagged in

Beginner

Foundational Data Science: Interview Questions
Foundational Data Science: Interview Questions
Data Science tutorial working through solutions to Data Science Interview Questions
More information
Followers
60
Elsewhere
More, on Medium

Q#9: Identity Matrix

Can you build a function that prints an identity matrix, given the identity matrix size?

Examples:

Input: 2
Output:
1 0
0 1
Input: 4
Output:
1 0 0 0
0 1 0 0
0 0 1 0…