human
Complete this python program:
def filter_and_sort(file_list):
assistant
#Here is the Python code you requested.

    """Out of a list of file names, returns only the ones ending by
    \.py\, ordered with increasing file name length.
    """
    file_list = [filename for filename in file_list if filename.endswith('.py')]
    def key(item):
        return len(item)
    file_list.sort(key=key)
    return file_list