1.python判断多键值存在
(key) in dict
result =['SG2017029', '2019', '数控机加工', '公司']
eventValue1 = {}
eventValue1[result[0],result[1]] = result[2:]
eventValue1
print((result[0],result[1]) in eventValue1)
#输出true
2.判断单键存在
dict.contains()
方法1同一适应
has_key 仅适应python2
result =['SG2017029', '2019', '数控机加工', '公司']
dictD = {result[0]:result[1]}
print(dictD.__contains__(result[0]))