From a6eb459b611b67132c76e34095afd87a5aada78c Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Tue, 20 Oct 2015 09:57:53 +0530 Subject: Modified string format [python/en] --- python.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 42a52bcf..01e5d481 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -123,8 +123,11 @@ not False # => True # A string can be treated like a list of characters "This is a string"[0] # => 'T' -# % can be used to format strings, like this: -"%s can be %s" % ("strings", "interpolated") +#String formatting with % +#Even though the % string operator will be deprecated on Python 3.1 and removed later at some time, it may still be #good to know how it works. +x = 'apple' +y = 'lemon' +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 -- cgit v1.2.3 From b238a58c9768d3b7694c4f02cbfe5ba2cac0015a Mon Sep 17 00:00:00 2001 From: payet-s Date: Wed, 21 Oct 2015 17:48:04 +0200 Subject: [python/en] Fix typos --- python.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 42a52bcf..753d6e8c 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -15,8 +15,8 @@ executable pseudocode. Feedback would be highly appreciated! You can reach me at [@louiedinh](http://twitter.com/louiedinh) or louiedinh [at] [google's email service] Note: This article applies to Python 2.7 specifically, but should be applicable -to Python 2.x. Python 2.7 is reachong end of life and will stop beeign maintained in 2020, -it is though recommended to start learnign Python with Python 3. +to Python 2.x. Python 2.7 is reaching end of life and will stop being maintained in 2020, +it is though recommended to start learning Python with Python 3. For Python 3.x, take a look at the [Python 3 tutorial](http://learnxinyminutes.com/docs/python3/). It is also possible to write Python code which is compatible with Python 2.7 and 3.x at the same time, -- cgit v1.2.3 From cdd64ecee34af20ed101ba5dc8d7dc73a8189c15 Mon Sep 17 00:00:00 2001 From: Vipul Sharma Date: Thu, 29 Oct 2015 15:23:37 +0530 Subject: 80 char and proper commenting --- python.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'python.html.markdown') diff --git a/python.html.markdown b/python.html.markdown index 01e5d481..ff4471e9 100644 --- a/python.html.markdown +++ b/python.html.markdown @@ -124,7 +124,8 @@ not False # => True "This is a string"[0] # => 'T' #String formatting with % -#Even though the % string operator will be deprecated on Python 3.1 and removed later at some time, it may still be #good to know how it works. +#Even though the % string operator will be deprecated on Python 3.1 and removed +#later at some time, it may still be good to know how it works. x = 'apple' y = 'lemon' z = "The items in the basket are %s and %s" % (x,y) -- cgit v1.2.3