diff options
Diffstat (limited to 'dictionaries/quickref.tex')
-rw-r--r-- | dictionaries/quickref.tex | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dictionaries/quickref.tex b/dictionaries/quickref.tex new file mode 100644 index 0000000..40c2256 --- /dev/null +++ b/dictionaries/quickref.tex @@ -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()|} |