From c16506f7d0e8cf5ed0c4c80301a3f9dfb5f185aa Mon Sep 17 00:00:00 2001 From: Aashutosh Kattel <90999891+aashu-kattel@users.noreply.github.com> Date: Sun, 2 Oct 2022 18:41:29 +0545 Subject: [PATCH] .py prog. to check anagrams --- Python/check_anagram.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Python/check_anagram.py diff --git a/Python/check_anagram.py b/Python/check_anagram.py new file mode 100644 index 0000000..4bcc950 --- /dev/null +++ b/Python/check_anagram.py @@ -0,0 +1,15 @@ +# program to check anagram + +from collections import Counter + +def check(s1, s2): + + # implementing counter function + if(Counter(s1) == Counter(s2)): + print("The given strings are anagrams.") + else: + print("The given strings are not anagrams.") + +s1 = input("Enter 1st word :") +s2 = input("Enter 2nd word :") +check(s1, s2)