def filter_by_extension(filenames, extensions):
    """Takes two lists of strings. Return only strings that end with any of 
    the strings in extensions. 
    
    """
    filtered = []
    for extension in extensions:
        filtered = filtered + [f for f in filenames if f.endswith(extension)]
    return filtered