summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorSrinivasan R <srinivasanr@gmail.com>2015-10-28 16:25:54 +0530
committerSrinivasan R <srinivasanr@gmail.com>2015-10-28 16:25:54 +0530
commitdb903ac5b6c80fa4b0e8502fb4b3abfd1bed07ee (patch)
tree984b2e2c5dca188ffaa86bfdb01bb3fe638d5185 /python.html.markdown
parent927ac9c3e83e9181f4ef3917417cd768ef205a10 (diff)
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 753d6e8c..3d63183c 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -128,6 +128,7 @@ not False # => True
# 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")