Re: a problem about "print"

Discussion in 'Python' started by Chris Angelico, Jul 4, 2012.

  1. On Wed, Jul 4, 2012 at 5:28 PM, levi nie <> 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
    Chris Angelico, Jul 4, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bad_Kid
    Replies:
    3
    Views:
    3,933
    Shawn H. Mesiatowsky
    Apr 7, 2005
  2. Bryan Shaw

    Lock Print Screen and File Print

    Bryan Shaw, Apr 19, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,933
    Kevin Spencer
    Apr 20, 2005
  3. keto
    Replies:
    0
    Views:
    897
  4. Lew
    Replies:
    0
    Views:
    625
  5. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    335
    David Cournapeau
    Dec 30, 2008
Loading...

Share This Page