DEV Community

Discussion on: TIL: Python Comprehensions Make Matrices Work

Collapse
 
veky profile image
Veky

The answer is really simple: how many lists do you make? If you really want a 5x5 zero matrix, it's quite obvious you need 6 lists. If you make only 2 of them, some (many) of them are going to be the same.