def most_frequent(mylist):
        return max(set(mylist), key = mylist.count)
      
      Python language logo

      Most frequent element in a list

      Python public recipes

      Shortcut: list.most_frequent

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.