clarkgrubb / hyperpolyglot

hyperpolyglot.org
Other
473 stars 94 forks source link

Update "variable interpolation"/"here document"/"expression interpolation" Python sections to indicate support for string interpolation in Python 3.6 #67

Open cjguttormsson opened 7 years ago

cjguttormsson commented 7 years ago

Python 3.6 added the ability to interpolate variables into strings using this syntax (following the other examples):

Variable interpolation:

count = 3
item = 'ball'
print(f'{count} {item}s')

Here documents:

word = "amet"

s = f"""lorem ipsum
dolor sit {word}"""

Expression interpolation:

f'1 + 1 = {1 + 1}'

The relevant sections should be updated to indicate these capabilities.