Advertisement
pacho_the_python

comapny users

Mar 14th, 2022
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. data = input().split(" -> ")
  2.  
  3. employee_dict = {}
  4.  
  5. while True:
  6.  
  7.     factory = data[0]
  8.  
  9.     if factory == "End":
  10.         break
  11.  
  12.     employee_id = data[1]
  13.     if factory not in employee_dict:
  14.         employee_dict[factory] = [employee_id]
  15.     else:
  16.         if employee_id not in employee_dict[factory]:
  17.             employee_dict[factory] += [employee_id]
  18.     data = input().split(" -> ")
  19.  
  20. for j in employee_dict:
  21.     print(f"{j}")
  22.     for k in employee_dict[j]:
  23.         print(f"-- {k}")
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement