How to group as defined by having their first element common, and keep them in a list of lists? : <p>I have a list as</p>

<pre><code>list1 = [(4356, 'OPIL', 2), (4356, 'OILY', 3), (5986, 'UISL', 1), (6985, 'LIBK', 3), (6985, 'LIBK', 1)]
</code></pre>

<p>I want output to be like this:
Output:</p>

<pre><code>result = [[(4356, 'OPIL', 2),(4356, 'OILY', 3)],[(5986, 'UISL', 1)], [(6985, 'LIBK', 3), (6985, 'LIBK', 1)]]
</code></pre>

<p>How do we do it?</p>
