Write a simple function, named
is_anagram, taking two strings, and returning a boolean value.
The function shall return
True if the letters of one word are a rearrangement of the letters of the other,
Superfluous (or missing) spaces, quotes, dashes, ... are allowed:
funeral is an anagram of
Capitalized letter are equivalent to lower case letters:
Madam Curie is an anagram of
Diactirics of any language are ignored:
crâné is an anagram of
Don't use the
unidecode library: it is not installed on the correction server.
Don't use a big replacement dict, or a big chain of
.replace: it is not clean and you'll always forget some, like: Ÿ, ǹ, j̄…
Your goal is just to remove diacritics, which can be done using the unicode normal form decomposed or the string and then remove the combining characters.
There's no corrections yet, hit the `Submit` button to send your code to the correction bot.