Last active
December 5, 2019 01:49
-
-
Save FerdinaKusumah/56de41d794eeb35a51a055aef090fc1c to your computer and use it in GitHub Desktop.
Check if 2 words is angrams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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