How to initialize a two-dimensional array in Python?
A pattern that often came up in Python was which helped motivate the introduction of list comprehensions, which convert that snippet to which is shorter and sometimes clearer. Usually you get in the habit of recognizing these and often replacing loops with comprehensions. Your code follows this pattern twice