1 | initial version |

As you correctly understood, `insert`

modifies a list in-place, and returns `None`

.

Instead of modifying the lists in place, one could create new lists.

One way would be to make the new list of lists using slices of the old lists.

Here is one way that could be done.

```
sage: Z = [[141, 163, 127], [107, 132, 117], [85, 116, 120], [121, 131, 128]]
sage: ZZ = [z[:i] + [0] + z[i:] for i, z in enumerate(Z)]
sage: ZZ
[[0, 141, 163, 127], [107, 0, 132, 117], [85, 116, 0, 120], [121, 131, 128, 0]]
```

2 | No.2 Revision |

As you correctly understood, `insert`

modifies a list in-place, ~~and returns ~~returning `None`

.

~~Instead of modifying the lists in place, one could ~~An alternative is to create new ~~lists.~~

One way would be to make the new list of lists lists, e.g. using slices of the old lists.

Here is one way ~~that could be done.~~to do that.

```
sage: Z = [[141, 163, 127], [107, 132, 117], [85, 116, 120], [121, 131, 128]]
sage: ZZ = [z[:i] + [0] + z[i:] for i, z in enumerate(Z)]
sage: ZZ
[[0, 141, 163, 127], [107, 0, 132, 117], [85, 116, 0, 120], [121, 131, 128, 0]]
```

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.