from collections import Counter
      
      result = Counter(mylist) # # Counter({'d': 5, 'b': 3, 'a': 2, 'c': 1})
      

      Python language logo
      Frequency of Elements in a List

      Python public recipes

      Shortcut: list.frequency

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.