python中判断某个元素(key)在list(字典)中是否存在

关键字:in 和 not in

             其中vocabulary为list

                if word not in vocabulary:
                    print(word)

 


版权声明:本文为qq_40228031原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。