summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorSpurlow <c.s.smith0616@gmail.com>2015-10-31 19:24:19 +0800
committerSpurlow <c.s.smith0616@gmail.com>2015-10-31 19:24:19 +0800
commit0e2b669c17fe04f02c1dee0d75450c029e8f1cf6 (patch)
tree35f7b3eec79098475fe3d281edf798c4cb15b3d3 /python.html.markdown
parent8d2dafd3bd4f30119d31dfb939bbad4ee213ca36 (diff)
parentdb903ac5b6c80fa4b0e8502fb4b3abfd1bed07ee (diff)
Merge pull request #1847 from cnu/master
Add one more string formatting example
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown1
1 files changed, 1 insertions, 0 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 7d7e4baf..2b43c5fc 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -132,6 +132,7 @@ z = "The items in the basket are %s and %s" % (x,y)
# A newer way to format strings is the format method.
# This method is the preferred way
+"{} is a {}".format("This", "placeholder")
"{0} can be {1}".format("strings", "formatted")
# You can use keywords if you don't want to count.
"{name} wants to eat {food}".format(name="Bob", food="lasagna")