Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #brand-size-wight-color
- l=["Aosco-small-58-red","Bosco-small-599-red","Cosco-small-57-red","Dosco-small-8-red"]
- name=input()
- d=dict({'brand':0,'size':1,'weight':2,'color':3})
- if name in d.keys():
- l.sort(key=lambda x: x.split('-')[d[name]])
- for i in l:
- print(l[0].split('-')[d[name]])
- print(i)
- else:
- print("INVALID INPUT")
Advertisement
Add Comment
Please, Sign In to add comment