dictionaries/quickref.tex
author Anoop Jacob Thomas<anoop@fossee.in>
Sat, 18 Dec 2010 12:54:49 +0530
changeset 524 b602b4dcc87d
parent 398 36295bb91766
permissions -rw-r--r--
Made some changes to the script embellishing a plot, but it still needs changes.

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()|}