Check if element exists in list in Python