python check if element exists in list of tuples