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


Groups > comp.lang.python > #7958

Re: What is this syntax ?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <enalicho@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; '2.7': 0.04; 'python': 0.08; '>>>>': 0.09; 'foo': 0.09; 'pm,': 0.10; 'syntax': 0.11; '>>>': 0.12; 'wrote:': 0.14; 'subject:syntax': 0.16; 'happening': 0.19; 'received:74.125.82.44': 0.19; 'received:mail- ww0-f44.google.com': 0.19; 'header:In-Reply-To:1': 0.21; 'documented': 0.23; 'message-id:@mail.gmail.com': 0.28; 'sun,': 0.30; 'print': 0.31; 'to:addr:python-list': 0.33; 'curious': 0.35; 'subject: ?': 0.35; 'subject:What': 0.35; 'received:google.com': 0.37; 'url:docs': 0.37; 'url:python': 0.38; 'received:74.125.82': 0.38; 'received:74.125': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'here': 0.66; 'subject:this': 0.76; '"foo"': 0.84; 'candide': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=pm2uYijeDD3HB9RcqTwrVeVPZwxv7ZDJMpXGM0k+AgY=; b=E5kknG5WqezN3hO+QshhHpiEBYZ7A6ZJNElwmiRlrNhfxbdJC1KO3yCHpnFVFskjtG D6FIneGDSqlawaAAGbNJ7VeLmui29AgetQMVqB1XMgw42XZ9rutojJ8gnOqiydS7KfIR Gv64YcZDsbIC/1fGrVySdt6A1tqrB20b2pdj0=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=jBESfSvLRxv03TvoSMQHHTxD6oXmdj0OxKap2STo9R72OeQnE6pIwX1PYltPjHMmXX oVA8oLkXlOXB/vDUV82IIpUATPnc9eFohnyILBjFZ5iUzmikdGW6WI+diJGeto/MPwk+ bpX4LnueUV/v/HoJJosCchZnCFCOOIMmZtPv4=
MIME-Version 1.0
In-Reply-To <4dfdfc99$0$715$426a34cc@news.free.fr>
References <4dfdfc99$0$715$426a34cc@news.free.fr>
From Noah Hall <enalicho@gmail.com>
Date Sun, 19 Jun 2011 14:58:41 +0100
Subject Re: What is this syntax ?
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.148.1308491943.1164.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 82.94.164.166
X-Trace 1308491943 news.xs4all.nl 49039 [::ffff:82.94.164.166]:33744
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7958

Show key headers only | View raw


On Sun, Jun 19, 2011 at 2:41 PM, candide <candide@free.invalid> wrote:
> With Python 2.7 :
>
>>>> x="foo"
>>>> print '"'+x+'"'
> "foo"

> What is this curious syntax on line 2 ? Where is it documented ?

Just to make it clear to you what is happening -

>>> x = "foo"
>>> print ' " ' + x + ' " '
 " foo "
>>>

Anyway, it's documented here -
http://docs.python.org/tutorial/introduction.html#strings

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


Thread

What is this syntax ? candide <candide@free.invalid> - 2011-06-19 15:41 +0200
  Re: What is this syntax ? Laurent Claessens <moky.math@gmail.com> - 2011-06-19 15:50 +0200
  Re: What is this syntax ? Noah Hall <enalicho@gmail.com> - 2011-06-19 14:58 +0100
  Re: What is this syntax ? Chris Angelico <rosuav@gmail.com> - 2011-06-20 00:03 +1000
  Re: What is this syntax ? candide <candide@free.invalid> - 2011-06-19 17:08 +0200
    Re: What is this syntax ? Roy Smith <roy@panix.com> - 2011-06-19 11:39 -0400
      Re: What is this syntax ? rusi <rustompmody@gmail.com> - 2011-06-19 09:58 -0700
        Re: What is this syntax ? Roy Smith <roy@panix.com> - 2011-06-19 16:20 -0400
          Re: What is this syntax ? Vito 'ZeD' De Tullio <zak.mc.kraken@libero.it> - 2011-06-19 23:06 +0200
            Re: What is this syntax ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-19 23:19 +0000
              Re: What is this syntax ? Vito 'ZeD' De Tullio <zak.mc.kraken@libero.it> - 2011-06-20 07:42 +0200
          Re: What is this syntax ? Benjamin Kaplan <benjamin.kaplan@case.edu> - 2011-06-19 15:29 -0700

csiph-web