The method strip() returns a copy of the string in which all chars have been stripped from the beginning and the end of the string (default whitespace characters).
chars -- The characters to be removed from beginning or end of the string.
str.strip([chars]);
#!/usr/bin/python str = "0000000this is string example....wow!!!0000000"; print str.strip( '0' )
When we run above program, it produces following result −
this is string example....wow!!!