【发布时间】:2016-11-25 20:42:50
【问题描述】:
如果我有一个单词列表:
list_of_words = ['great','debate','stronger']
还有一本字典:
dictionary = {'candidate1':['corruption','election'],'candidate2': ['lady','draintheswamp','stronger','debate'],'candidate3':['healthcare','oil']}
我必须创建一个函数来检测单词列表的生成者。
在上面的例子中:'Candidate2' 最有可能是 list_of_words 的产生者
请不要导入任何模块。效率不是这里的主要关注点。
【问题讨论】:
-
为什么不能导入任何模块?
标签: python list python-3.x loops dictionary