Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74306

Re: What does (A ``quote'' is the character used to open the string, i.e. either ' or ".) mean?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!lightspeed!lightspeed.eweka.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <joel.goldstick@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; '"this': 0.03; 'talks': 0.03; 'string.': 0.05; '"""': 0.07; 'string': 0.09; 'escape': 0.09; 'here?': 0.09; 'sequences.': 0.09; 'span': 0.09; 'strings.': 0.09; 'subject:string': 0.09; 'cc:addr:python-list': 0.11; '(these': 0.16; 'backslash': 0.16; 'character.': 0.16; 'examples:': 0.16; 'itself,': 0.16; 'literals': 0.16; 'newline,': 0.16; 'newlines': 0.16; 'optionally': 0.16; 'prefixed': 0.16; 'quoted': 0.16; 'retained),': 0.16; 'unescaped': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'starts': 0.20; 'rules': 0.22; 'cc:addr:python.org': 0.22; 'string,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'character': 0.29; 'generally': 0.29; 'characters': 0.30; 'matching': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'lines': 0.31; 'quotes': 0.31; 'terminate': 0.31; 'open': 0.33; 'url:python': 0.33; 'plain': 0.33; 'raw': 0.33; 'subject:the': 0.34; 'subject: (': 0.35; 'except': 0.35; 'received:google.com': 0.35; 'i.e.': 0.36; 'url:ref': 0.36; 'url:listinfo': 0.36; 'subject:?': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'two': 0.37; 'thank': 0.38; 'ends': 0.38; 'skip:. 20': 0.38; 'quote': 0.39; 'either': 0.39; 'called': 0.40; 'url:mail': 0.40; 'enclosed': 0.60; 'referred': 0.60; 'here:': 0.62; 'such': 0.63; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'subject:. ': 0.67; 'url:0': 0.67; 'helping': 0.70; 'jul': 0.74; 'special': 0.74; 'them)': 0.84; 'joel': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aEwnTB4f/3H5KUCGGF4y+n87jrtnFc42c13k6lBUkkQ=; b=OdD7pRMMR5Ye3zLwSiKLaQtFT4HgzF7w0q/iPsctBXrBS+PTCn2ilbMlnvEZPjZoQV cu9Bm6PUzE+L9TrOFBMLczy0D+pHKInQE7JCORYqTkidDtI1m3qXvV8qmc4iKc7gXEpU hOYlvgIk5RaT1GRS6NioDvfRlat5Y0ilOFR0Msyc8Ktd+E3MsGAkVrk0gO8QF0PSUy1F s/CA0VukkPLOSz2Rc1IIwBmb2gnh0HiWIZKyBo86pX6sD1NSP/SzOZQaZdT9Pys3B1dx yB6UTTnU3CjYtaI6lVQniskSqxVfewlTAP1tkC9fHkhisU7nWgF5JkXDtdZU1wBoaIJU lk9w==
MIME-Version 1.0
X-Received by 10.58.178.82 with SMTP id cw18mr528180vec.39.1405001668831; Thu, 10 Jul 2014 07:14:28 -0700 (PDT)
In-Reply-To <b0f2c8d2-c5a7-4b12-90f1-4aa8bfed9783@googlegroups.com>
References <b0f2c8d2-c5a7-4b12-90f1-4aa8bfed9783@googlegroups.com>
Date Thu, 10 Jul 2014 10:14:28 -0400
Subject Re: What does (A ``quote'' is the character used to open the string, i.e. either ' or ".) mean?
From Joel Goldstick <joel.goldstick@gmail.com>
To fl <rxjwg98@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.11728.1405001678.18130.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1405001678 news.xs4all.nl 2958 [2001:888:2000:d::a6]:44723
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 5656
X-Received-Body-CRC 363144753
Xref csiph.com comp.lang.python:74306

Show key headers only | View raw


On Thu, Jul 10, 2014 at 10:04 AM, fl <rxjwg98@gmail.com> wrote:
> Hi,
>
> For me, it is difficult to understand the last line of the paragraph below in
> parenthesis (A ``quote'' is the character used to open the string,
> i.e. either ' or ".)
>
> It talks about triple-quoted strings. Where is ``quote'' from? It has two ` and '.
> What this different ` and ' do for here?
>
> The link is here:
> https://docs.python.org/2.0/ref/strings.html
>
> Thank you for helping me to learn Python.
>
>
> ............................
> In plain English: String literals can be enclosed in matching single quotes (') or
> double quotes ("). They can also be enclosed in matching groups of three single
> or double quotes (these are generally referred to as triple-quoted strings). The
> backslash (\) character is used to escape characters that otherwise have a special eaning, such as newline, backslash itself, or the quote character. String literals
> may optionally be prefixed with a letter `r' or `R'; such strings are called raw
> strings and use different rules for backslash escape sequences.
>
> In triple-quoted strings, unescaped newlines and quotes are allowed (and are
> retained), except that three unescaped quotes in a row terminate the string. (A
> ``quote'' is the character used to open the string, i.e. either ' or ".)
> --
> https://mail.python.org/mailman/listinfo/python-list

Here are some examples:
'this is a single quoted string'
"this is a double quoted string"
"""this is a triple quoted string.  Note that it starts and ends with
three double quote characters.
It can also span lines
"""

'''If you like you can use single quotes (three of them) for the same effect'''



-- 
Joel Goldstick
http://joelgoldstick.com

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

What does (A ``quote'' is the character used to open the string, i.e. either ' or ".) mean? fl <rxjwg98@gmail.com> - 2014-07-10 07:04 -0700
  Re: What does (A ``quote'' is the character used to open the string,  i.e. either ' or ".) mean? Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-07-10 16:14 +0200
    Re: What does (A ``quote'' is the character used to open the string,  i.e. either ' or ".) mean? fl <rxjwg98@gmail.com> - 2014-07-10 08:23 -0700
      Re: What does (A ``quote'' is the character used to open the string,  i.e. either ' or ".) mean? MRAB <python@mrabarnett.plus.com> - 2014-07-10 17:48 +0100
      Re: What does (A ``quote'' is the character used to open the string,  i.e. either ' or ".) mean? Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-10 10:22 -0600
  Re: What does (A ``quote'' is the character used to open the string,  i.e. either ' or ".) mean? Joel Goldstick <joel.goldstick@gmail.com> - 2014-07-10 10:14 -0400

csiph-web