Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dictionary = {}
- count = int(input())
- for _ in range(count):
- line = input()
- line_split = line.split()
- command = line_split[0]
- name = line_split[1]
- if command == "register":
- plate_number = line_split[2]
- if name in dictionary:
- print(f"ERROR: already registered with plate number {dictionary[name]}")
- else:
- dictionary[name] = plate_number
- print(f"{name} registered {plate_number} successfully")
- else:
- if name not in dictionary:
- print(f"ERROR: user {name} not found")
- else:
- dictionary.pop(name)
- print(f"{name} unregistered successfully")
- for name, plate_number in dictionary.items():
- print(f"{name} => {plate_number}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement