, find():
>>> "hello".find("l")
2
>>> "hello".find("he")
0
>>> "hello".find("x")
-1
-1 " " " ". index():
>>> "hello".index("l")
2
>>> "hello".index("he")
0
>>> "hello".index("x")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: substring not found
index(), , , Python , - Pythonic - "EAFP" ( , ).
"LBYL" ( , ), , , if.