[docs] Reporting a Bug

anthony.flury anthony.flury at btinternet.com
Sat May 7 04:21:43 EDT 2022


This is exactly as expected.


Strip removes any of the characters in the passed string from both the 
front and the end of the string being stripped.

The letter 'T' from the start of 'The meaning of life' does not appear 
in the word 'meaning' so nothing is removed from the start of the 
string.


The letter 'e' from the end of 'The meaning of life' does appear in the 
word 'meaning' so it is removed from the sentence; it will then look at 
the next last letter 'f', but since this doesn't appear in the word 
'meaning' nothing else is removed and the new string is returned.

The argument passed to strip(..) method is the set of characters to be 
removed - so any characters in that set are removed from the start and 
end of the string.




------ Original Message ------
From: "Jeff Jeffi" <infojmail at gmail.com>
To: docs at python.org
Cc: python-list at python.org
Sent: Wednesday, 4 May, 22 At 10:36
Subject: [docs] Reporting a Bug

Hello dears,

First of all i am not sure about this issue       please advise me if 
there is any mistake   in my report.


  for example in python 3.6.3 shell:


>>> x= "The meaning of life" x.strip("meaning")
'The meaning of lif'


As you see the letter "e" of  the word "life"  is removed.


Sincerely yours.
J.Mohammadi




  _______________________________________________
docs mailing list -- docs at python.org
To unsubscribe send an email to docs-leave at python.org
https://mail.python.org/mailman3/lists/docs.python.org/ 
<https://mail.python.org/mailman3/lists/docs.python.org/>
Member address: anthony.flury at btinternet.com

-- <br>Anthony Flury<br>anthony.flury at btinternet.com


More information about the Python-list mailing list