How do I create a multiline Python string with inline variables?
The common way is the format() function: >>> s = “This is an {example} with {vars}”.format(vars=”variables”, example=”example”) >>> s ‘This is an example with variables’ It works fine with a multi-line format string: >>> s=””‘\ … This is a {length} example. … Here is a {ordinal} line.\ … ”’.format(length=”multi-line”, ordinal=”second”) >>> print(s) This is a … Read more