import linecache


def getlines(filename, begin, end):
    """
    Returns a list of lines read from filename.

    `end` is inclusive.
    """

    return [linecache.getline(filename, lineno) for lineno in range(begin, end + 1)]