Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
endswith
endswith
Return True if the string ends with the specified suffix, otherwise return False.
Python 3.13
1
str
.
endswith
(
suffix
[
,
start
[
,
end
]
]
)
suffix
The suffix to check for.
start
The starting position for the check.
end
The ending position for the check.
Examples
Python 3.13
1
'hello'
.
endswith
(
'lo'
)
True