Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input()
- data = {}
- all_languages = []
- while not command == 'exam finished':
- command = command.split("-")
- if command[1] == "banned":
- name = command[0]
- del data[name]
- command = input()
- continue
- elif not command[1] == 'banned':
- name = command[0]
- language = command[1]
- points = int(command[2])
- if name not in data:
- data[name] = points
- else:
- if points > data[name]:
- data[name] = points
- all_languages += [language]
- command = input()
- print('Results:')
- for key, value in data.items():
- print(f'{key} | {value}')
- print('Submissions:')
- for subm in range(len(set(all_languages))):
- final_copy = all_languages.copy()
- result = sorted(list(set(all_languages)), reverse=True)
- current_language = result[subm]
- print(f"{result[subm]} - {final_copy.count(current_language)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement