Advertisement
fumanbest

Key-Key Value-Value

Aug 20th, 2020
874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. k_to_find = input()
  2. v_to_find = input()
  3. num = int(input())
  4. my_dict = {}
  5.  
  6. for i in range(num):
  7.     tok = input().split(' => ')
  8.     key = tok[0]
  9.     value = tok[1].split(';')
  10.     my_dict[key] = value
  11. for j in my_dict.keys():
  12.     if k_to_find in j:
  13.         print(f'{j}:')
  14.     for v in my_dict[j]:
  15.         if v_to_find in v:
  16.             print(f'-{v}')
  17.  
  18.  
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement