+ 1
What is the use of strip() function in python
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
+ 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))
0
just copy my first post into
python playground and see the output