Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created June 3, 2021 05:58
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 amankharwal/dcb057343169a5a61814b73a4246f42c to your computer and use it in GitHub Desktop.
Save amankharwal/dcb057343169a5a61814b73a4246f42c to your computer and use it in GitHub Desktop.
def anagram(word1, word2):
word1 = word1.lower()
word2 = word2.lower()
return sorted(word1) == sorted(word2)
print(anagram("cinema", "iceman"))
print(anagram("cool", "loco"))
print(anagram("men", "women"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment