Skip to content

Commit

Permalink
Basic list most/least common helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkmcknz committed May 11, 2016
1 parent 413cfb2 commit 32afbbe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions isac/utils/common/helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def most_common(lst):

return max(set(lst), key=lst.count)


def least_common(lst):

return min(set(lst), key=lst.count)

0 comments on commit 32afbbe

Please sign in to comment.