Hi,
I have searched the web but couldn’t find the appropriate keywords in english for the following : How can I check if a value is in a list of lists?
I know how to search if avalue is in an list :
if property in obj:
instructions
How can I know if the value “Elisa” is in the list :
friends_List = [[“Jenny”, 25, “Australian”], [“Elisa”, 28, “French”]]
The following script doesn’t seem to work for a list with more than one “level” :
if "Elisa" in friends_List:
instructions
I’d like to avoid doing this :
for num in range (len(friends_List)-1):
if "Elisa" in friends_List[num]
instructions
because that would not suit lists with too many “levels” (what’s the word for that?).
Thank you