def _insert_out_prompt_and_split_lines(
        self, result: Iterable[OneStyleAndTextTuple], out_prompt: AnyFormattedText
    ) -> Iterable[StyleAndTextTuples]:
        r"""
        Split styled result in lines (based on the \n characters in the result)
        an insert output prompt on whitespace in front of each line. (This does
        not yet do the soft wrapping.)

        Yield lines as a result.
        """
        out_prompt = to_formatted_text(out_prompt)
        out_prompt_width = fragment_list_width(out_prompt)
        prefix = ("", " " * out_prompt_width)

        for i, line in enumerate(split_lines(result)):
            if i == 0:
                line = [*out_prompt, *line]
            else:
                line = [prefix, *line]
            yield line

        Split styled result in lines (based on the \n characters in the result)
        an insert output prompt on whitespace in front of each line. (This does
        not yet do the soft wrapping.)

        Yield lines as a result.
        
src/ptpython/printer.py