Skip to content

Instantly share code, notes, and snippets.

@FerdinaKusumah
Last active December 5, 2019 01:49
Show Gist options
  • Save FerdinaKusumah/56de41d794eeb35a51a055aef090fc1c to your computer and use it in GitHub Desktop.
Save FerdinaKusumah/56de41d794eeb35a51a055aef090fc1c to your computer and use it in GitHub Desktop.
Check if 2 words is angrams
from collections import Counter
"""Check if two words is anagram"""
a = "listen"
b = "silent"
is_anagrams = Counter(a) == Counter(b)
print("Is {} and {} is Anagrams ? {}".format(a, b, is_anagrams))
# Is listen and silent is Anagrams ? True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment