我有这个密码:
while True:
words = {}
aorl = raw_input("Add or look up a word (a/l)? ")
if aorl == "a":
word = raw_input("Type the word: ")
definition = raw_input("Type the definition: ")
words[word] = str(definition)
print "Word added!"
elif aorl == "l":
type = raw_input("Type the word: ")
if type == ??:
???
如果用户查找一个单词以找到定义,我将如何从字典中打印定义?你知道吗
你用这个词把定义编入索引,所以只要用这个词,从字典里得到定义就行了。你知道吗
相关问题 更多 >
编程相关推荐