Advertisement
here2share

# optimized_most_in_list.py

Jul 28th, 2023
1,992
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.11 KB | None | 1 0
  1. # optimized_most_in_list.py
  2.  
  3. k = [4, 2, 3, 2, 1, 1, 1, 2, 2, 4]
  4. most = max(set(k), key=k.count)
  5. print(most)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement