aboutsummaryrefslogtreecommitdiff
path: root/challenge-011/lubos-kolouch/python/ch-2.py
blob: 442bd8d82a80012defe002c41e7cd30b524af4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env python
# -*- coding: utf-8 -*-

size = 4  # change this to the desired size
identity_matrix = [[0 for x in range(size)] for y in range(size)]

for i in range(size):
    identity_matrix[i][i] = 1

# print the identity matrix
for row in identity_matrix:
    print(row)