Thanks for all your error reports, I didn't forget it. I'll cleanup my guide soon. Thanks again!

Dictionaries

#### Making a dictionary ####
data = {}
# OR #
data = dict()
 
#### Initially adding values ####
data = {'a':1,'b':2,'c':3}
# OR #
data = dict(a=1, b=2, c=3)
 
#### Inserting/Updating value ####
data['a']=1  # updates if 'a' exists, else adds 'a'
# OR #
data.update({'a':1})
# OR #
data.update(dict(a=1))
 
#### Merging 2 dictionaries ####
data.update(data2)  # Where data2 is also a dict.

Discussion

Navigation

Learn Linux The Hard Way