def count(input_, condition=lambda x: True):
    """Count the number of items in an iterable for a given condition

    For example:
        >>>count("abc")
        3
        >>>count("abc", condition=lambda x: x=="a")
        1
    """
    return sum(condition(item) for item in input_)