File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <div align =" center " >
2+
3+ # Anagram Checker
4+
5+ </div >
6+
7+ ### Description:
8+ This Python script checks if two words are anagrams of each other.
9+
10+ ### How to Use:
11+ 1 . Run the script in a Python environment.
12+ 2 . Enter the first word when prompted.
13+ 3 . Enter the second word when prompted.
14+ 4 . The script will determine whether the two words are anagrams of each other and display the result.
Original file line number Diff line number Diff line change 1+ def is_anagram (word1 , word2 ):
2+ return sorted (word1 .lower ()) == sorted (word2 .lower ())
3+
4+
5+ def main ():
6+ word1 = input ("Enter the first word: " )
7+ word2 = input ("Enter the second word: " )
8+ if is_anagram (word1 , word2 ):
9+ print ("Yes, the words are anagrams of each other!" )
10+ else :
11+ print ("No, the words are not anagrams." )
12+
13+
14+ if __name__ == "__main__" :
15+ main ()
You can’t perform that action at this time.
0 commit comments