aneliabogeva

09. Wardrobe

Jul 5th, 2019
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. colors = {}
  2.  
  3. for each_time in range((int(input()))):
  4. command = [item for item in input().split(" -> ")]
  5. values = [item for item in command[1].split(",")]
  6.  
  7. for value in values:
  8. if command[0] not in colors:
  9. colors[command[0]] = {}
  10. colors[command[0]][value] = 1
  11. elif command[0] in colors:
  12. if value not in colors[command[0]]:
  13. colors[command[0]][value] = 1
  14. elif value in colors[command[0]]:
  15. colors[command[0]][value] += 1
  16.  
  17. command_check = [item for item in input().split(" ")]
  18.  
  19. for color, item in colors.items():
  20. print(f"{color} clothes:")
  21. for values, count in item.items():
  22. if command_check[0] == color and command_check[1] == values:
  23. print(f"* {values} - {count} (found!)")
  24. else:
  25. print(f"* {values} - {count}")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×