- list.index():最初に出現するインデックス
サンプルコード:sample_348.py
x = ["a", "b", "c", "d", "e", "f"]
print(x.index("c"))
実行結果
2
サンプルコード:sample_349.py
x = ["a", "b", "c", "d", "c", "c"]
print(x.index("c"))
実行結果
2
サンプルコード:sample_350.py
x = [1, 2, 3, 4, 5]
print(x.index(3))
実行結果
2
サンプルコード:sample_351.py
x = ["a", "b", "c"]
print(x.index("z"))
実行結果
ValueError: 'z' is not in list
- ABC013 A - A
- ABC018 A - 豆まき
- ABC141 A - Weather Prediction
- ABC146 A - Can't Wait for Holiday
- ABC170 A - Five Variables
- ABC275 A - Find Takahashi
- ABC277 A - ^{-1}
- ABC033 B - 町の合併
- ABC113 B - Palace
- ABC213 B - Booby Prize
- ABC308 B - Default Price
- ABC365 B - Second Best
- CODE FESTIVAL 2015 予選B B - 採点
- 第5回 ドワンゴからの挑戦状 予選 A - Thumbnail