Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Verify Anagrams by mangeurdecowan
def verify_anagrams(a, b):
a = sorted([i.lower() for i in a if i.isalpha()])
b = sorted([i.lower() for i in b if i.isalpha()])
return sorted(a) == sorted(b)
if __name__ == '__main__':
print("Example:")
print(verify_anagrams('Programming', 'Gram Ring Mop'))
# These "asserts" are used for self-checking and not for an auto-testing
assert verify_anagrams('Programming', 'Gram Ring Mop') == True
assert verify_anagrams('Hello', 'Ole Oh') == False
assert verify_anagrams('Kyoto', 'Tokyo') == True
print("Coding complete? Click 'Check' to earn cool rewards!")
July 19, 2021