diff options
author | Srinivasan R <srinivasanr@gmail.com> | 2015-10-28 16:25:54 +0530 |
---|---|---|
committer | Srinivasan R <srinivasanr@gmail.com> | 2015-10-28 16:25:54 +0530 |
commit | db903ac5b6c80fa4b0e8502fb4b3abfd1bed07ee (patch) | |
tree | 984b2e2c5dca188ffaa86bfdb01bb3fe638d5185 | |
parent | 927ac9c3e83e9181f4ef3917417cd768ef205a10 (diff) |
Add one more string formatting example
-rw-r--r-- | python.html.markdown | 1 |
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") |