Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- all_results = {}
- best_results = {}
- command = input()
- while command != "exam finished":
- command = command.split("-")
- username = command[0]
- if command[1] == "banned":
- if username in best_results.keys():
- del best_results[username]
- else:
- language = command[1]
- points = int(command[2])
- if language not in all_results:
- all_results[language] = 0
- all_results[language] += 1
- if username not in best_results.keys():
- best_results[username] = {'language': language, 'points': points}
- else:
- if points > best_results[username]['points']:
- best_results[username] = {'language': language, 'points': points}
- command = input()
- print("Results:")
- for key, value in best_results.items():
- print(f"{key} | {value['points']}")
- print("Submissions:")
- for lang, num in all_results.items():
- print(f"{lang} - {num}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement