(s1,s2)
| 1 | def anagram_checker(s1,s2): |
| 2 | list1 = list(s1) |
| 3 | list2 = list(s2) |
| 4 | |
| 5 | list1.sort() |
| 6 | list2.sort() |
| 7 | |
| 8 | pos = 0 |
| 9 | matches = True |
| 10 | if len(list1) != len(list2): |
| 11 | return False |
| 12 | |
| 13 | while pos < len(s1) and matches: |
| 14 | if list1[pos] == list2[pos]: |
| 15 | pos = pos + 1 |
| 16 | else: |
| 17 | matches = False |
| 18 | |
| 19 | return matches |
| 20 | |
| 21 | # Example - |
| 22 | # print(anagram_checker('abcde','edcba')) |