+ 1

What is the use of strip() function in python

24th Oct 2017, 1:34 PM
Alex
3 Réponses
+ 2
string="**1357753***123***" string = string .strip("*") print(string ) ## This method returns a copy of the string in which all chars have been stripped from the beginning and the end of the string. ##output will be : 1357753***123 remember beginning and last
24th Oct 2017, 2:18 PM
sayan chandra
sayan chandra - avatar
+ 1
why named strip???------> stripping means what... removing cover## suppose the string is ////ggjyscjkezhk//// u did......this string.strip("/") means compiler will take that // this thing is a cover and it will remove it..from beginning and last... (covers doesnt exist in middle))
24th Oct 2017, 2:20 PM
sayan chandra
sayan chandra - avatar
0
just copy my first post into python playground and see the output
24th Oct 2017, 2:18 PM
sayan chandra
sayan chandra - avatar