Ejemplo n.º 1
0
def is_anagram(a, b):
    a = a.lower()
    b = b.lower()
    hist_a = char_histogram(a)
    hist_b = char_histogram(b)

    for key in hist_a:
        if hist_a[key] != hist_b[key]:
            return False
    return True
Ejemplo n.º 2
0
def is_anagram(a, b):
    a = a.lower()
    b = b.lower()
    if len(a) != len(b):
        return False

    dict_a = char_histogram(a)
    dict_b = char_histogram(b)

    for i in dict_a:
        if dict_a[i] != dict_b[i]:
            return False
        else:
            continue
    return True