Skip to content

Instantly share code, notes, and snippets.

@pycoders0000
Created December 17, 2022 12:31
Show Gist options
  • Save pycoders0000/6db19f605cba93ca813be3c614351dc8 to your computer and use it in GitHub Desktop.
Save pycoders0000/6db19f605cba93ca813be3c614351dc8 to your computer and use it in GitHub Desktop.
# -- 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