th0m45s5helby

Untitled

Oct 26th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. #brand-size-weight-color
  2. l=["Aosco-small-58-red","Bosco-small-599-red","Cosco-small-57-red","Dosco-small-8-red"]
  3. name=input()
  4. d=dict({'brand':0,'size':1,'weight':2,'color':3})
  5. if name in d.keys():
  6.     l.sort(key=lambda x: x.split('-')[d[name]])
  7.     for i in l:
  8.         print(i.split('-')[d[name]])
  9.         print(i)
  10. else:
  11.     print("INVALID INPUT")
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment