Top Stories published by Foundational Data Science: Interview Questions in September of 2020

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…

About
Foundational Data Science: Interview Questions
Data Science tutorial working through solutions to Data Science Interview Questions
More information
Tags
Editors