anagrams python

# function to check if two strings are 
# anagram or not  
def check(s1, s2): 
      
    # the sorted strings are checked  
    if(sorted(s1)== sorted(s2)): 
        print("The strings are anagrams.")  
    else: 
        print("The strings aren't anagrams.")          
          
# driver code   
s1 ="listen"
s2 ="silent" 
check(s1, s2) 

4.1
10
Keith Lee 110 points

                                    from collections import defaultdict

def findAnagrams(input_str):
    anagram = defaultdict(list)

    for word in input_str:
        anagram[str(sorted(word))].append(word)
    return list(anagram.values())

4.1 (10 Votes)
0
4
1
Rakib Ansary 105 points

                                    def isAnagram(A,B):
  if sorted(A) == sorted(B):
    print("Yes")
  else:
    print("No")
isAnagram("earth","heart") #Output: Yes

#Hope this helps:)

4 (1 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
python set anagram\ make anagram in python program for anagram in python python code for anagram and special anagram python code for anagram anagram pythoin what is anagram in python? what is anagram in python anagram ? anagram define how to write a program on anagrams in python implement anagram python anagram meaning in python anagramma in python anagram algorithm python "anagram" is_anagram python anagrama python Anagram pyhton how to do anagrams python anagram py anagram' fun with anagram python anagram definition anagram python coding anagram prgram in python is anagram python set() anagram program anagrams python 3 anagram of anagram anagram porblem in python anagram programming anagram ' make anagrams python anagram in python algorithm ANAGRAM PYTHON 3 python create anagrams anagram. anagrams python function is anagram in python anagram code in python Where my anagrams at? python anagram python set anagrams anagramms in python python check if strings are anagrams convert two words into anagrams python check if two words are anagrams python nagrams in python what a anagram python how to find anagram in python two strings are anagrams or not in python check anagram using python compare anagrams python how to tell if two strings are anagrams python python anagram program anagrams problem in python strings is anagram in python3 checking anagrams in python anagram program python best anagram solution in python anagram check in python how to check if two words are anagrams in python quick sort anagram python how to write a python anagram finder how to check if anagram python python anagram function check if anagram in list python function to find anagram to check whether two strings are anagram or not in python anagram checker python check if anagram python python check if anagram python program for anagram anagram using python python anagram checker anagram solver python string anagrams in python anagram check python finding anagrams in python finding anagrams in a string python return anagrams of one word python program to check anagram in python two strings are anagrams python check if word is sub anagram python fastest way to check for anagrams in python how to find anagrams from a list how many anagrams a words has in python python is anagram write a function to check a list of words to detect anagrams finding anagram in python is anagram python anagram python problem check anagrams python anagram like python anagram comparison python anagram function python check anagram python How would you determine if two strings are anagrams python anagram words in python function check Blanagrams(word1, word2) in python function checkBlanagrams(word1, word2) in python anagrams python program digit anagrams python valid anagram python by dictionary anagram examples in python anagram function python aragram python anagram python program python check for anagram python anagram from list python check anagram anagram checking in python find anagrams in a list of words python check if 2 strings are anagrams python python code to check anagram how to tell if a word is an anagram in python python anagram find anagrams of a word python anagram of string in python anagram problem in python fastest anagram python Anagrams in python how to check anagram in python fun with anagrams python python anagram for two lists python anagrtam check if two strings are anagrams python anagram in python python function to compare anagrams how to solve anagrams in python anagram program in python anagramme python string angramme python string check anagram in python anagram python string anagram in python anagrams python scramble checker python python anagrams
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source