PyDocs

Nav

Python Runtime Services

str.endswith

builtins

method of str
  • str.endswith(suffix[, start[, end]])
Return True if the string ends with the specified suffix, False otherwise.

suffix
  A string or a tuple of strings to try.
start
  Optional start position. Default: start of the string.
end
  Optional stop position. Default: end of the string.
1 Example
>>> 'Python'.endswith('on')
True
>>> 'a tuple of suffixes'.endswith(('at', 'in'))
False
>>> 'a tuple of suffixes'.endswith(('at', 'es'))
True
>>> 'Python is amazing'.endswith('is', 0, 9)
True
from the Python docs
See Also
No see-alsos for builtins/str.endswith
0 Notes
No notes for str.endswith