Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14301

How do I create a multiline Python string with inline variables?

$
0
0

I am looking for a clean way to use variables within a multiline Python string. Say I wanted to do the following:

string1 = gostring2 = nowstring3 = great"""I will $string1 thereI will go $string2$string3"""

I'm looking to see if there is something similar to $ in Perl to indicate a variable in the Python syntax.

If not - what is the cleanest way to create a multiline string with variables?


Viewing all articles
Browse latest Browse all 14301

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>