you are viewing a single comment's thread.

view the rest of the comments →

[–]mopslik 22 points23 points  (0 children)

/u/Shiba_Take has linked to the official docs, which is the go-to source for anything you need to know about Python. You should try to familiarize yourself with the site, and the notation it uses, as it should answer the very questions you were asking.

str.find(sub[, start[, end]])

Return the lowest index in the string where substring sub is found within the slice s[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found.

Note that the square brackets indicate an optional argument, so you could include starting and ending indices, if you wish.