# Title: Anagram check
# Heading: Python Program to Check if Two Strings Are Anagrams
# Level: beginner
# Tags: anagram, sorted, compare strings, counter
# About: Checks whether two words or phrases are anagrams, made of exactly the same letters, by sorting the letters of each and comparing them.

def is_anagram(first, second):
    """True if first and second use exactly the same letters."""
    # Capitals and spaces don't count
    first = first.lower().replace(" ", "")
    second = second.lower().replace(" ", "")
    return sorted(first) == sorted(second)


print("listen and silent:", is_anagram("listen", "silent"))
print("The eyes and they see:", is_anagram("The eyes", "they see"))
print("apple and paper:", is_anagram("apple", "paper"))
