Skip to content

Instantly share code, notes, and snippets.

@mtayseer
Created March 25, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtayseer/8fee5fb9630bb54c8145 to your computer and use it in GitHub Desktop.
Save mtayseer/8fee5fb9630bb54c8145 to your computer and use it in GitHub Desktop.
Check if two statements are anagrams
# How to run?
# > python are_anagrams.py hello lolhe
# True
from collections import Counter
import sys
print(Counter(sys.argv[1]) == Counter(sys.argv[2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment