#coding:utf-8 dict={'beijing':{'haidingqu':['qinghe','keji'],'chaoyangqu':['q','w']},'shandong':{'liaochen':['chiping','yanggu'],'dezhou':['e','r']}} for index,i in enumerate(dict): #首先循环显示一级菜单 print index,i, print '退出q' #后补上的退出功能,一一添加到字典中显麻烦,索性先显示出来