I want to set a variable to a certain value in a list. I need to find where the specific string is in the list without knowing what the contents of the list will be. For instance:
list = ["a", "b", "c"]
valueIWantToFind = "b"
# code that finds where value is
variable = list.1
I thought of doing a for loop, but I don't know how to get the current value of the list to compare it to the value I want to find.
Some thing like this:
for x in list:
if(valueIWantToFind == currentValueOfList):
variable = currentValueOfList
else:
continue