Skip to content

Instantly share code, notes, and snippets.

@Pythonian
Created May 28, 2022 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pythonian/a66ad378638cef453802f80607fbea0b to your computer and use it in GitHub Desktop.
Save Pythonian/a66ad378638cef453802f80607fbea0b to your computer and use it in GitHub Desktop.
def find_anagram(word, anagram):
if sorted(word) == sorted(anagram):
print(f"TRUE::: '{word} and {anagram}' are anagrams of each other.")
else:
print(f"FALSE::: The two strings '{word} and {anagram}' contradict each other.")
if __name__ == "__main__":
find_anagram("below", "elbow")
find_anagram("hello", "check")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment