<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>I would like to know how I could use the insert method in a List matrix eg. for the matrix below<br><br>M=[[1,2,3], [3,2,1], [4,3,2]]<br><br>if wanted to insert the string 'pod' in list [0] before [1] in list [0] in M using the built in method insert How would I go about doing this? I've tried may List Comprehension possibilities but none of then worked. Below are some of the things I tried. <br><br>&gt;&gt;&gt; M=[[1,2,3], [3,2,1], [4,3,2]]<br>&gt;&gt;&gt; M.insert([1][1], 'pod')<br><br>Traceback (most recent call last):<br>&nbsp; File "&lt;pyshell#19&gt;", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; M.insert([1][1], 'pod')<br>IndexError: list index out of range<br>&gt;&gt;&gt; [row[0] for row in M.insert(1, 'pod')]<br><br>Traceback (most recent call last):<br>&nbsp; File
 "&lt;pyshell#20&gt;", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; [row[0] for row in M.insert(1, 'pod')]<br>TypeError: 'NoneType' object is not iterable<br>&gt;&gt;&gt; M.insert(1,'pod')<br>&gt;&gt;&gt; M<br>[[1, 2, 3], 'pod', 'pod', [3, 2, 1], [4, 3, 2]]<br>&gt;&gt;&gt; M.insert[0](1,'pod')<br><br>Traceback (most recent call last):<br>&nbsp; File "&lt;pyshell#23&gt;", line 1, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; M.insert[0](1,'pod')<br>TypeError: 'builtin_function_or_method' object is unsubscriptable<br><br><br>Any help is greatly appreciated! Thanks!<br><br>-Raj<br></div></div><br>



      </body></html>