Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = input()
- input_list = []
- input_dict = {}
- while not data == 'end':
- input_list = data.split(' -> ')
- if input_list[1] in input_dict.keys():
- reset_val = input_dict[input_list[1]]
- input_dict[input_list[0]] = reset_val
- elif input_list[0] in input_dict.keys():
- try:
- checker = list(map(int, input_list[1].split(',')))
- input_dict[input_list[0]] += ", " + input_list[1]
- except:
- pass
- else:
- try:
- checker = list(map(int, input_list[1].split(',')))
- input_dict[input_list[0]] = input_list[1]
- except:
- pass
- data = input()
- for key, val in input_dict.items():
- print(f'{key} === {val}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement