Created
January 6, 2023 14:04
-
-
Save quincynyan/8801ff4d541f3f7f25d17c19b92fe142 to your computer and use it in GitHub Desktop.
Anagrams
This file contains 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
test_list = ['lump', 'eat', 'em', 'tea', 'me', 'plum'] | |
for ele in test_list: | |
num = 0 | |
for ele2 in test_list: | |
if sorted(ele) == sorted(ele2): | |
num += 1 | |
print(ele, "has", num, "anagrams") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment