Python String endswith() MethodPython endswith() method returns true of the string ends with the specified substring, otherwise returns false. SignatureParameters
Start and end both parameters are optional. Return TypeIt returns a boolean value either True or False. Let's see some examples to understand the endswith() method. Python String endswith() Method Example 1A simple example which returns true because it ends with dot (.). Output: True Python String endswith() Method Example 2It returns false because string does not end with is. Output: False Python String endswith() Method Example 3Here, we are providing start index of the range from where method starts searching. Output: False Python String endswith() Method Example 4It returns true because third parameter stopped the method at index 13. Output: True Next TopicPython Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India