String interpolation: Difference between revisions

Content deleted Content added
Go: add reference to closed string interpolation github issues
Python: clarify variable names in example
Line 317:
|title= The Python Tutorial: 7.1.1. Formatted String Literals}}</ref><ref>{{Cite web |url=https://docs.python.org/3/reference/lexical_analysis.html#f-strings |title=The Python Language Reference: 2.4.3. Formatted string literals}}</ref><ref>{{Cite web|url=https://www.python.org/dev/peps/pep-0498/|title = PEP 498 -- Literal String Interpolation}}</ref> Such a literal begins with an <code>f</code> or <code>F</code> before the opening quote, and uses braces for placeholders:
<syntaxhighlight lang="python">
applesnum_apples = 4
bananasnum_bananas = 3
print(f'I have {applesnum_apples} apples and {bananasnum_bananas} bananas')
</syntaxhighlight>
The output will be: