Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
strip
strip
Return a copy of the string with the leading and trailing characters removed.
Python 3.13
str
.
strip
(
[
chars
]
)
chars
The characters to be removed (defaults to whitespace).
Examples
Python 3.13
>>
>
' hello world '
.
strip
(
)
'hello world'