题解 | #记录喜好的字典#
记录喜好的字典
https://www.nowcoder.com/practice/b48ac65b70534898a2900dfad254d8d9
dic={'Java':['NiuNiu','Tony'],'Python':['NiuMei','NiuNeng'],'CPP':['Niukele','Anna','Allen']} name = input() print(dic[name] if any(k==name for k,v in dic.items()) else 'Nobody') # 用any判断迭代结果中是否有真来检查是否是不存在的人名