Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- participants = input().split(', ')
- songs = input().split(', ')
- info = {}
- while True:
- command = input()
- if command == 'dawn':
- break
- participant, song, award = command.split(', ')
- if participant in participants and song in songs:
- if participant not in info.keys():
- info[participant] = [award]
- if award not in info[participant]:
- info[participant].append(award)
- if len(info) > 0:
- for key in sorted(info, key=lambda k: len(info[k]), reverse=True):
- print(f'{key}: {len(info[key])} awards')
- for value in sorted(info[key]):
- print(f'--{value}')
- else:
- print('No awards')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement