python check if string is in list of tuples