Created
December 17, 2022 12:31
-
-
Save pycoders0000/6db19f605cba93ca813be3c614351dc8 to your computer and use it in GitHub Desktop.
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
# -- coding: utf-8 -- | |
# @Date : 2022-12-28 05:00:00 | |
# @Author : pycoder.py | |
# @GitHub : (https://github.com/pycoders0000) | |
# @Twitter : (https://twitter.com/pycoder0000) | |
# @Instagram : (https://www.instagram.com/pycoder.py/) | |
# @version : 1.0.0 | |
def anagram(word1, word2): | |
word1 = word1.lower() | |
word2 = word2.lower() | |
return sorted(word1) == sorted(word2) | |
anagram('cinema', 'iceman') | |
anagram('man', 'woman') | |
# Program to check whether two strings are anagrams. | |
# Returns True if they are and False if they aren't. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment