a problem about "print"

levi nie levinie001 at gmail.com
Wed Jul 4 10:15:09 CEST 2012


Yes,you are right.

2012/7/4 Chris Angelico <rosuav at gmail.com>

> On Wed, Jul 4, 2012 at 5:28 PM, levi nie <levinie001 at 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
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120704/69ed374c/attachment.html>


More information about the Python-list mailing list