python - dictionary key-call -
im building test program. database of bugs , bug fixes. may end being entire database time working in python. want create effect of layers using dictionary.
here code of april 29 2011:
modules=['pass'] syntax={'print':''' in eclipse anthing "print" needs within set of paranthesis''','strret':'anytime need use return action in string, must use triple quotes.'} findinp= input('''where go? dir:''') if findinp=='syntax': print(syntax) dir2= input('choose listing') if dir2=='print'or'print'or'print': print('print' in syntax)
now when use entire dictionary, not first layer. how this? need list links in console? or there better way so?
thanks, pre.shu.
i'm not quite sure want, print content of single key of dictionary index it:
syntax['print']
maybe bit:
modules=['pass'] syntax={ 'print':''' in eclipse anthing "print" needs within set of paranthesis''', 'strret':'anytime need use return action in string, must use triple quotes.'} choice = input('''where go? dir:''').upper() if choice in syntax: print syntax[choice] else: print "no data ..."
Comments
Post a Comment