title: How to remove duplicate months and years from python list?
body: <p>How can we remove duplicate months and years from python list? Here's my code it's not working fine. I can't think of any solution.</p>
  <pre><code>a = ['26/09/2021', '29/09/2021','26/07/2021', '29/07/2021','26/07/2021', '29/09/2021','26/07/2022', '29/09/2022']
  
  
  def rdm(l):
      l = sorted(list(set(l)))
      for i in l:
          print(&quot;/&quot;.join(i.split('/')[1:3]))
  
  rdm(a)
  </code></pre>
  <p>Output :</p>
  <pre><code>07/2021
  07/2022
  09/2021
  07/2021
  09/2021
  09/2022
  </code></pre>
  <p>Required output:</p>
  <pre><code>07/2021
  07/2022
  09/2021
  09/2022
  </code></pre>