差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
python:find_index [2019/05/18 02:23] – 外部編集 非ログインユーザー | python:find_index [2019/08/19 06:52] (現在) – ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 文字列検索 ====== | + | ====== 文字列検索(find, index) |
+ | |||
+ | ===== find, index ===== | ||
+ | <code python> | ||
+ | find(' | ||
+ | index(' | ||
+ | </ | ||
<code python> | <code python> | ||
a = ' | a = ' | ||
行 6: | 行 13: | ||
-1 | -1 | ||
a.index(' | a.index(' | ||
- | ValueError | + | Traceback (most recent call last): |
+ | File "< | ||
+ | ValueError: substring not found | ||
a.find(' | a.find(' | ||
行 21: | 行 30: | ||
-1 | -1 | ||
a.index(' | a.index(' | ||
- | ValueError | + | Traceback (most recent call last): |
+ | File "< | ||
+ | ValueError: substring not found | ||
</ | </ | ||
+ | |||
+ | ===== 参考文献 ===== | ||
+ | [[https:// | ||
+ |