from functools import reduce


def balanced(txt):
    """
   Given a string containing only lowercase letters, 
   find whether every letter that appears in the string appears the same number of times.
    """
    if len(txt) <= 1: return True
    count_txt = dict() #same as using the Counter class from collections lib.
    for char in txt:
        count_txt[char] = count_txt.get(char, 0) + 1
    return reduce(lambda x,y: x==y, count_txt.values())