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


Groups > comp.lang.python > #74321

Re: I am confused about ' and "

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!enother.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!gordon
From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: I am confused about ' and "
Date Thu, 10 Jul 2014 17:16:18 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 17
Message-ID <lpmhp2$f1u$1@reader1.panix.com> (permalink)
References <cfa25009-b200-4fcc-beb7-83634546cd20@googlegroups.com>
NNTP-Posting-Host panix1.panix.com
X-Trace reader1.panix.com 1405012578 15422 166.84.1.1 (10 Jul 2014 17:16:18 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Thu, 10 Jul 2014 17:16:18 +0000 (UTC)
User-Agent nn/6.7.3
X-Received-Bytes 1465
X-Received-Body-CRC 192243083
Xref csiph.com comp.lang.python:74321

Show key headers only | View raw


In <cfa25009-b200-4fcc-beb7-83634546cd20@googlegroups.com> fl <rxjwg98@gmail.com> writes:

> Please tell me because I have looked it around for one hour about it.

There is no difference between ' and " when used to enclose strings, with
one exception: a double-quoted string can contain single-quotes without the
need to escape them with a backslash, and vice-versa.

For example:

    string2 = "It's a beautiful day in the neighboorhood."
    string1 = 'He said to me, "Hello Thomas."'

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon@panix.com    watch 'House', or a real serial killer to watch 'Dexter'.

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


Thread

I am confused about ' and " fl <rxjwg98@gmail.com> - 2014-07-10 10:01 -0700
  Re: I am confused about ' and " John Gordon <gordon@panix.com> - 2014-07-10 17:16 +0000
  Re: I am confused about ' and " Chris Angelico <rosuav@gmail.com> - 2014-07-11 03:57 +1000
  Re: I am confused about ' and " Joel Goldstick <joel.goldstick@gmail.com> - 2014-07-10 14:12 -0400
  Re: I am confused about ' and " Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-07-10 20:25 +0200

csiph-web