Answers for "find item in list based on string"

43

python find item in list

>>> ["foo", "bar", "baz"].index("bar")
1
Posted by: Guest on November-19-2019
1

python find string in list

list1 = ["a", "b", "c"]

isBInList = "b" in list1 # True
Posted by: Guest on August-23-2020

Code answers related to "find item in list based on string"

Python Answers by Framework

Browse Popular Code Answers by Language