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


Groups > comp.lang.python > #24851 > unrolled thread

Re: a problem about "print"

Started byChris Angelico <rosuav@gmail.com>
First post2012-07-04 17:40 +1000
Last post2012-07-04 17:40 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#24851 — Re: a problem about "print"

FromChris Angelico <rosuav@gmail.com>
Date2012-07-04 17:40 +1000
SubjectRe: a problem about "print"
Message-ID<mailman.1780.1341387647.4697.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web