title: group the sublist seperatly inside the list based on condition in python
body: <p>i have sublist</p>
  <pre><code>list=[['RD-2','a',120],
        ['RD-2','b',125],
        ['RD-2','c',127],
        ['RD-3','a',120],
        ['RD-3','b',140],
        ['RD-5','a',120]]
  </code></pre>
  <p>i want to make seperate sublists in the list based on 1st element of every sublist if its same. The output should be like below</p>
  <pre><code>finallist=[
             [['RD-2','a',120],['RD-2','b',125],['RD-2','c',127]],   
             [['RD-3','a',120],['RD-3','b',140]],
             ['RD-5','a',120]]
  </code></pre>
  <p>i tried in forloop using if condition but its not working.
  help me</p>