eNeRGy90

Untitled

Jan 20th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. lines = int(input())
  2. wardrobe = {}
  3.  
  4. for line in range(0, lines):
  5.     clothes = input()
  6.     color, types = clothes.split(' -> ')
  7.     if color not in wardrobe:
  8.         wardrobe[color] = {}
  9.     for type in str(types).split(','):
  10.         if type in wardrobe[color]:
  11.             wardrobe[color][type] += 1
  12.         else:
  13.             wardrobe[color][type] = 1
  14.  
  15. display_color, display_item, *rest = input().split(' ')
  16.  
  17. for color, items in wardrobe.items():
  18.     print(f'{color} clothes:')
  19.     for item, quantity in items.items():
  20.         print(f'* {item} - {quantity}' + ' (found!)' if display_color == color and display_item == item else f'* {item} - {quantity}')
Add Comment
Please, Sign In to add comment