python check if key exists in list