python check if value exists in list and get index