1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-06 06:47:54 +02:00

Merge pull request #3171 from lowlevelware/master

[python3/en] added example for f-string
This commit is contained in:
Adam Bard
2018-08-01 20:47:55 -07:00
committed by GitHub

View File

@@ -138,6 +138,10 @@ len("This is a string") # => 16
# still use the old style of formatting:
"%s can be %s the %s way" % ("Strings", "interpolated", "old") # => "Strings can be interpolated the old way"
# You can also format using f-strings or formatted string literals
name = "Reiko"
f"She said her name is {name}." # => "She said her name is Reiko"
# None is an object
None # => None