Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check(word, anagram):
- # Code to find Anagrams in two words
- first_word = input("Enter the first word:") #This code allow input from user
- second_word = input("Enter the second word:")
- #Converting the input into lower case
- first_word = first_word.lower()
- second_word = second_word.lower()
- #conditional statement to find if they are anagram
- if(sorted(first_word) == sorted(second_word)):
- print(f"The words {first_word} and {second_word} are anagram")
- else:
- print(f"The words {first_word} and {second_word} are not anagram")
- check("first_word","second_word")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement