title: sorting a list by names in python
body: <p>I have a list of filenames. I need to group them based on the ending names after underscore ( _ ). My list looks something like this:</p>
  
  <pre><code>[
      '1_result1.txt',
      '2_result2.txt',
      '3_result2.txt',
      '4_result3.txt',
      '5_result4.txt',
      '6_result1.txt',
      '7_result2.txt',
      '8_result3.txt',
  ]
  </code></pre>
  
  <p>My end result should be:</p>
  
  <pre><code>List1 = ['1_result1.txt', '6_result1.txt']
  
  List2 = ['2_result2.txt', '3_result2.txt', '7_result2.txt']
  
  List3 = ['4_result3.txt', '8_result3.txt']
  
  List4 = ['5_result4.txt']
  </code></pre>