>>> d = {} >>> d["teague"] = "math" >>> d {'teague': 'math'} >>> d["avineri"] = "math" >>> d["spells"] = "chem" >>> d {'teague': 'math', 'avineri': 'math', 'spells': 'chem'} >>> # dictionary is a collectionof key-value pairs >>> # keys must be hashable, values don't have to be. >>> d["morrison"] = "math" >>> d {'teague': 'math', 'avineri': 'math', 'spells': 'chem', 'morrison': 'math'} >>> d["morrison"] = "compsci" >>> d {'teague': 'math', 'avineri': 'math', 'spells': 'chem', 'morrison': 'compsci'} >>> "aveneri" in d False >>> "avineri" in d True >>> # quack in dict checkjs is quack is a key >>> "math" in d.values() True >>> "spells" in d.keys() True >>> d.keys() dict_keys(['teague', 'avineri', 'spells', 'morrison']) >>> list(d.keys()) ['teague', 'avineri', 'spells', 'morrison'] >>> for q in d.keys(): print( q) ... teague avineri spells morrison >>> type(None) >>> import random >>> random.randint(1,6) 6 >>> random.randint(1,6) 5 >>> random.randint(1,6) 6 >>> random.randint(1,6) 1 >>> (random.randint(1,6),random.randint(1,6)) (1, 1) >>> (random.randint(1,6),random.randint(1,6)) (6, 2) >>> (random.randint(1,6),random.randint(1,6)) (4, 5) >>> (random.randint(1,6),random.randint(1,6)) (2, 5) >>> (random.randint(1,6),random.randint(1,6)) (4, 1) >>> (random.randint(1,6),random.randint(1,6)) (2, 2) >>> (random.randint(1,6),random.randint(1,6)) (1, 5) >>>