Advertisement
aneliabogeva

Key-Key Value-Value

Jul 2nd, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. key_to_be_found = input()
  2. value_to_be_found = input()
  3. n = int(input())
  4.  
  5. data_dict = {}
  6.  
  7. for num in range(0, n):
  8. data_list = input().split(' => ')
  9. key = data_list[0]
  10. value = data_list[1].split(';')
  11.  
  12. data_dict[key] = value
  13.  
  14. for key, value in data_dict.items():
  15. if key_to_be_found in key:
  16. print(f"{key}:")
  17. for el in value:
  18. if value_to_be_found in el:
  19. print(f"-{el}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement