diff -r 4aea9ed09983 -r 36295bb91766 dictionaries/quickref.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dictionaries/quickref.tex Sun Nov 07 18:36:59 2010 +0530 @@ -0,0 +1,20 @@ +Defining dictionary:\\ +{\ex \lstinline| d = {'k1':'v1', 'k2':'v2'}|} + +Access value using key in dictionary:\\ +{\ex \lstinline| print d['k1']|} + +Add key-value pair to dictionary:\\ +{\ex \lstinline| d['k3'] = 'v3'|} + +Delete key-value from dictionary:\\ +{\ex \lstinline| del d['k1']|} + +Check container-ship of key in dictionary:\\ +{\ex \lstinline| 'k2' in d|} + +List of keys in dictionary:\\ +{\ex \lstinline| d.keys()|} + +List of values in dictionary:\\ +{\ex \lstinline| d.values()|}