Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command = input()
- company = {}
- while not command == "End":
- company_name, employee_id = command.split("->")
- if company_name not in company:
- company[company_name] = []
- company[company_name].append(employee_id)
- if employee_id in company.keys():
- del employee_id
- command = input()
- filtered_companies = sorted(company.items(), key=lambda kvp: kvp[0])
- for company_name, employee_id in filtered_companies:
- print(f"{company_name}")
- for el in employee_id:
- print(f"--{el}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement