Python Morsels Exercise

Determine whether the given words are anagrams

3 bonuses 9 hints 11 solutions 852 users solved 45 reviews

I want you to write a function that accepts two strings and returns True if the two strings are anagrams of each other.

Your function should work like this:

>>> is_anagram("tea", "eat")
>>> is_anagram("tea", "treat")
>>> is_anagram("sinks", "skin")
>>> is_anagram("Listen", "silent")

Make sure your function works with mixed case.

Before you try to solve any bonuses, I recommend you try to find at least two ways to solve this problem.

Okay now to the bonuses...

Bonus 1

This is just a preview of the problem statement.

This exercise includes 3 bonuses and 9 hint links.

To solve this exercise, sign in to your Python Morsels account.

A learning habit for experienced Pythonistas

Profile picture of Trey

My name is Trey Hunner and I hold Python trainings for teams. I've spent countless hours refining my most interesting Python exercises into Python Morsels, a Python skill-building platform for folks who already know Python. Python Morsels is design to help you deepen your Python skills every week.

Sign up for Python Morsels to access this exercise and many more.

Join Python Morsels ✨