The return value of the find() method is an integer value. Both the start_index_number and the end_index_number specify the range over which the search will take place and they narrow the search down to a particular section. ![]() ![]() It specifies the end index and where the search will stop. end_index_number is the third parameter and it's also optional.It specifies the starting index and the position from which the search will start. start_index_number is the second parameter and it's optional.This is the substring you are trying to find inside string_object. "substring" is the first required parameter.The find() method takes three parameters – one required and two optional.This could be any word you want to search through. string_object is the original string you are working with and the string you will call the find() method on.The general syntax for the find() method looks something like this: string_object.find("substring", start_index_number, end_index_number) It takes a substring as input and finds its index - that is, the position of the substring inside the string you call the method on. The find() string method is built into Python's standard library. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |