refdict中的单词是键还是值?
您的代码将只看到密钥:例如:
refDict = { 'w':'x', 'y':'z' } for word in [ 'w','x','y','z' ]: if word not in refDict: print word
印刷品:
x z
你想要什么;
如果单词不在refdict.values()中
当然,这相当于假设您的字典是一个实际的python字典,这似乎是一种存储单词列表的奇怪方式。