Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #find a way to display the most populair item
- from collections import Counter #import Counter from collections
- order_drinks = ["Tea","Coffee","Tea","Tea","Coffee","Hot Chocolate","Tea"] #this is the list
- i = Counter(order_drinks)#using a constructor to create a class item?
- print(i.most_common()) #display the most common value, in order from high to low
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement