I have come across this:
item = someSortOfSelection() if item in myList: doMySpecialFunction(item)
but sometimes it does not work with
While the answer from Niklas B. is pretty comprehensive, when we want to find an item in a list it is sometimes useful to get its index:
next((i for i, x in enumerate(lst) if [condition on x]), [default value])