Screen Link:
My Code:
this is the solution provided:
matrix_of_ones = []
for _ in range(7):
matrix_of_ones.append([1, 1, 1])
What I expected to happen:
After checking the solution provided, I expected to see a list of lists in which the first element of each list would be a number from 0-6. This is because I used the range(7) function. The range(7) function should create an output like the one below:
0
1
2
3
4
5
6
so, why didn’t each appended list inside matrix_of_ones resulted as:
[[0, [1,1,1]],
[1, [1,1,1]],
[2, [1,1,1]]…until
[6, [1,1,1]]]