summaryrefslogtreecommitdiffhomepage
path: root/python3.html.markdown
diff options
context:
space:
mode:
authorroot <root@learnxinyminutes.com>2018-08-02 04:08:30 +0000
committerroot <root@learnxinyminutes.com>2018-08-02 04:08:30 +0000
commit6f2003a31f900c1ce3ff1dde64b17c7ac02350cc (patch)
tree2d7f1f3c82fb125d11b7a59062fd52be6dacad17 /python3.html.markdown
parent40de8820dbf8a4695d31384aca69c85a4e34d066 (diff)
parent8a6a3db546868f8c159e61eec6f89b8a83efd25a (diff)
Merge branch 'master' of https://github.com/adambard/learnxinyminutes-docs
Diffstat (limited to 'python3.html.markdown')
-rw-r--r--python3.html.markdown4
1 files changed, 4 insertions, 0 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index 019934cb..d6cfbf59 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -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