Advertisement
Guest User

Wardrobe_Softuni

a guest
Jan 17th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. from collections import Counter
  2.  
  3. n = int(input())
  4. wardrobe = {}
  5. count_list = []
  6. for i in range(n):
  7.     dress = input()
  8.     dress_arg = dress.split(" -> ")
  9.     dress = dress_arg[1]
  10.     color = dress_arg[0]
  11.     count_list = dress.split(",")
  12.  
  13.     if color in wardrobe:
  14.         wardrobe[color] += count_list
  15.     else:
  16.         wardrobe[color] = count_list
  17.  
  18. looking_dress = input()
  19. looking_arg = looking_dress.split(" ")
  20.  
  21. for i, j in wardrobe.items():
  22.     print(f"{i} clothes:")
  23.     final_count = Counter(j)
  24.     for k, c in final_count.items():
  25.         if i == looking_arg[0] and k == looking_arg[1]:
  26.            print(f"* {k} - {c} (found!)")
  27.         else:
  28.             print(f"* {k} - {c}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement