diff --git a/Python/anagram_checker.py b/Python/anagram_checker.py new file mode 100644 index 00000000..ebfb93e0 --- /dev/null +++ b/Python/anagram_checker.py @@ -0,0 +1,20 @@ +def anagram_checker(s1,s2): + list1 = list(s1) + list2 = list(s2) + + list1.sort() + list2.sort() + + pos = 0 + matches = True + + while pos < len(s1) and matches: + if list1[pos] == list2[pos]: + pos = pos + 1 + else: + matches = False + + return matches + +# Example - +# print(anagram_checker('abcde','edcba'))