pretty strange behavior of "strip"

Discussion in 'Python' started by Guy Doune, Dec 4, 2008.

  1. Guy Doune

    Guy Doune Guest

    Hi everybody,

    Could it be a bug?????

    Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
    [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> test=['03.html', '06.html', 'questions.html', '04.html',

    'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html']
    >>> test

    ['03.html', '06.html', 'questions.html', '04.html', 'toc.html',
    '01.html', '05.html', '07.html', '02.html', '08.html']
    >>> test[4]

    'toc.html'
    >>> test[4].strip('.html')

    'oc'

    Can't figure out what is going on, really.

    Guy
    Guy Doune, Dec 4, 2008
    #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. Mantorok Redgormor
    Replies:
    70
    Views:
    1,753
    Dan Pop
    Feb 17, 2004
  2. Chad
    Replies:
    9
    Views:
    298
    Keith Thompson
    Apr 5, 2006
  3. Aquila
    Replies:
    35
    Views:
    450
    Mathieu Bouchard
    Mar 31, 2005
  4. yelipolok
    Replies:
    4
    Views:
    252
    John W. Krahn
    Jan 27, 2010
  5. Rodrick Brown

    Odd strip behavior

    Rodrick Brown, Mar 22, 2012, in forum: Python
    Replies:
    0
    Views:
    153
    Rodrick Brown
    Mar 22, 2012
Loading...

Share This Page