Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- university = {}
- collect = input()
- while collect != "exam finished":
- if "banned" in collect.split("-"):
- username = collect.split("-")[0]
- del university[language]["users"][username]
- else:
- username, language, points = collect.split("-")
- if language not in university:
- university[language] = {"count": 1, "users": {username: points}}
- else:
- university[language]["count"] += 1
- if username not in university[language]["users"]:
- university[language]["users"][username] = points
- else:
- if points > university[language]["users"][username]:
- university[language]["users"][username] = points
- collect = input()
- print("Results:")
- for language, data in university.items():
- for user, points in data["users"].items():
- print(f"{user} | {points}")
- print("Submissions:")
- for language, data in university.items():
- print(f"{language} - {data['count']}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement