Write a python program to check two strings are Anagram or not

Write a python program to check two strings are Anagram or not

Program
from collections import Counter
def myfun():
    a = 'sateesh'
    b = 'hseetas'
    if(Counter(a)==Counter(b)):
        print("Both strings are Anagram")
    else:
        print("Both strings are not Anagram")
                 
if __name__=="__main__":
    myfun()


Output:

Both strings are Anagram


Using sorted() function
def myfun():
    a = 'sateesh'
    b = 'hseetas'
    if sorted(a)== sorted(b):
        print('Anagrams')
    else:
        print("Not anagrams")
                 
if __name__=="__main__":
    myfun()


Output:

Anagrams



More Questions


42 . Write a python program to check two strings are Anagram or not
43 . Write a python program to checking internet speed
44 . Write a python program to print reserved keywords
45 . Write a python program to print properties and methods
46 . Write a python program to open a website using python
47 . Write a python program to print most frequent letter in a string
48 . Write a python program to check memory sizes of list ,set ,tuple
49 . How do you confirm if an object is iterable using code?
50 . Write a python program to sort list with sorted & lambda
51 . Write a python program to access news using python
52 . Write a python program to print lowercase names



For latest job updates join Telegram Channel: https://t.me/sateeshm