Многострочные строки в следующем примере намеренно имеют отступ:
Код: Выделить всё
from textwrap import dedent
block_a = """\
Line one
Line two"""
block_b = """\
Line four
Line five"""
blocks = f"""\
{block_a}
Line three
{block_b}"""
print(dedent(blocks))
Код: Выделить всё
Line one
Line two
Line three
Line four
Line five
Код: Выделить всё
Line one
Line two
Line three
Line four
Line five
Код: Выделить всё
Line one
Line two
Line three
Line four
Line five
Код: Выделить всё
blocks = """\
{}
Line three
{}"""
print(dedent(blocks).format(dedent(block_a), dedent(block_b)))
Подробнее здесь: https://stackoverflow.com/questions/793 ... -variables