Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming Fundamentals using Python Day 8, Problem Assignment 54 #8

Open
ShubhamSood1406 opened this issue Sep 1, 2020 · 2 comments

Comments

@ShubhamSood1406
Copy link
Contributor

import collections

def check_anagram(data1,data2):

results = dict(collections.Counter(data1))
sort_orders = sorted(results.items(), key=lambda x: x[1], reverse=True)
if(sort_orders[0][1] > 1):
    return False

elif len(data1) == len(data2):
    if(sorted(data1.lower()) == sorted(data2.lower())):
       return True
        
    return False
return False

print(check_anagram("eat", "tea"))
print(check_anagram("backward","drawback"))
print(check_anagram("Reductions","discounter"))
print(check_anagram("About", "table"))

@ShubhamSood1406
Copy link
Contributor Author

Solution of Programming Fundamentals using Python Day 8, Problem Assignment 54

@github-actions
Copy link

github-actions bot commented Sep 1, 2020

Message that will be displayed on users' first issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant