Advertisement
aneliabogeva

Odd Occurrences

Jun 22nd, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. words = [item for item in input().split(" ")]
  2. counts = {}
  3. counts_result = []
  4.  
  5. for word in words:
  6. if word.lower() in counts:
  7. counts[word.lower()] += 1
  8. else:
  9. counts[word.lower()] =1
  10. for word in counts:
  11. if counts[word] % 2 != 0:
  12. counts_result.append(word)
  13. print(",".join(counts_result))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement