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


Groups > comp.lang.python > #24851

Re: a problem about "print"

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'string.': 0.04; 'class,': 0.07; 'function,': 0.07; 'received:mail-vc0-f174.google.com': 0.09; 'alist': 0.16; 'distinction': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'str()': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'string,': 0.17; 'subject:problem': 0.22; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; "doesn't": 0.28; 'received:209.85.220.174': 0.29; 'str': 0.29; 'function': 0.30; 'print': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'list': 0.35; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'anything': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'takes': 0.39; 'header:Received:5': 0.40; 'more.': 0.62; 'jul': 0.65
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 :content-type; bh=Abo/+GmtS/VdUQ1F5TrIxVupLYZQ5AcgSeJD8ntxvFA=; b=PKhlZll1DR+ICUWO3XsTLZznhG1yFss61RiV9wfhxS7JifaDoCsNk4cgt8FlZk18w+ QcvVJ9eTWZ9IYataT99eaU9+kgZ8ACYjEE45/L9umSO+5RPLKo694vifNKzpNgACRwA1 Z9/Ml/PLKPS0ql87UTnmVAgOnpuU70HpDoxzFrkFe05EO1M7WPfqsJq6gh2xKi53p+9r y/D3KvwDX7lGykJHciGiDVWsyI5JKsfUOak+zqASF+zNEsbBI9FassetkTzsCpFvWcqN ZG/7J0f98jmLRththL2isqwFmCVxEhE63ZBYr7pSc6GF/xm8emi4piX45SguTDXG2MsC rtiQ==
MIME-Version 1.0
In-Reply-To <CAEMsKDv8vk0hkjPxd=xe=N7UmQzw9VYY1aTUaf3wk-CALEkJBw@mail.gmail.com>
References <CAEMsKDvjCqnetyhCA=F-jeOLdr-hcyYFN+DhO0OoaackE9mrkQ@mail.gmail.com> <CAEMsKDv0G40W61pbkUadzuRfe+eNVn5WS4iJDCioG+jTfeveYQ@mail.gmail.com> <CAJRADaOt3phGQ=afTy8TOX_qdtGv7zxfzvs2yp1S4GdgdZ=mkQ@mail.gmail.com> <CAEMsKDuejD6UcPrQ9LjiUxEEKjbY8Of7YS8O7kNo65hT3SerbQ@mail.gmail.com> <CAJRADaNqGOF+s-Eq_BNWh+4wsdPcVuttV0zWG1bmw_nyNFHM7Q@mail.gmail.com> <CAEMsKDv8vk0hkjPxd=xe=N7UmQzw9VYY1aTUaf3wk-CALEkJBw@mail.gmail.com>
Date Wed, 4 Jul 2012 17:40:44 +1000
Subject Re: a problem about "print"
From Chris Angelico <rosuav@gmail.com>
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.1780.1341387647.4697.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1341387647 news.xs4all.nl 6989 [2001:888:2000:d::a6]:34675
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:24851

Show key headers only | View raw


On Wed, Jul 4, 2012 at 5:28 PM, levi nie <levinie001@gmail.com> wrote:
> aList=str(aList)
> print aList
> print aList[2]

The str() function takes pretty much anything and returns a string.
When you subscript a string, you get characters. It's not a list of
numbers any more.

(Technically str is a class, not a function, but that distinction
doesn't matter.)

ChrisA

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


Thread

Re: a problem about "print" Chris Angelico <rosuav@gmail.com> - 2012-07-04 17:40 +1000

csiph-web