-
-
Save mtayseer/e5c45ded6a3f67629ca4 to your computer and use it in GitHub Desktop.
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
import math | |
def string_norm(s): | |
return math.sqrt(sum(ord(c) ** 2 for c in s if c != ' ')) | |
def anagram_detection(s1,s2): | |
return string_norm(s1) == string_norm(s2) | |
s1 = input("Please enter first string: ").lower() | |
s2 = input("Please enter second string: ").lower() | |
print ("Anagram.") if anagram_detection(s1, s2) else print ("Not Anagram.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment