ChainMap({'__name__': '__main__', '__doc__': 'Automatically created module for IPython interactive environment', '__package__': None, '__loader__': None, '__spec__': None, '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '_ih': ['', 'eng2sp = {}\neng2sp["one"] = "uno"\neng2sp["two"] = "dos"\neng2sp["three"] = "tres"\nprint(eng2sp)', 'from IPython.display import IFrame\nIFrame("http://pythontutor.com/iframe-embed.html#code=eng2sp%20%3D%20%7B%7D%0Aeng2sp%5B%22one%22%5D%20%3D%20%22uno%22%0Aeng2sp%5B%22two%22%5D%20%3D%20%22dos%22%0Aeng2sp%5B%22three%22%5D%20%3D%20%22tres%22&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false", width=\'100%\', height=450)', "eng2sp = {'three': 'tres', 'one': 'uno', 'two': 'dos'}\nvalue = eng2sp['two']\nprint(value)", 'd = {"apples": 430, "bananas": 312, \n "oranges": 525, "pears": 217}\n\nl = [(\'apples\', 430), (\'bananas\', 312),\n (\'oranges\', 525), (\'pears\', 217)]', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,[30,40])\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,(30,40))\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', "a = dict(one=1, two=2)\nb = {'one':1, 'two':2}\nc = dict(zip(['one','two'],[1,2]))\nd = dict([('two',2),('one',1)])\ne = dict({'two':2, 'one':1})\na == b == c == d == e", "DIAL_CODES = [\n (86, 'China'),\n (91, 'India'),\n (1, 'United States'),\n (7, 'Russia'),\n (81, 'Japan'),\n (55, 'Brazil'),\n (234, 'Nigeria')\n]", 'country_codes = {country:code for code, country in DIAL_CODES}\nprint(country_codes)', '{code:country.upper() for country, code in country_codes.items() if code < 66}', 'inventory = {"apples": 430, "bananas": 312, "oranges": 525, "pears": 217}\n\ndel inventory["oranges"]\n\nprint(inventory)', 'inventory["pears"] = 0\nprint(inventory)', 'inventory["oranges"] = 0\n\nprint(len(inventory))\nprint(inventory)', 'for k in eng2sp.keys(): \n print("Got key", k, "which maps to value", eng2sp[k])\n\nprint(type(eng2sp.keys()))\nks = list(eng2sp.keys())\nprint(ks)', 'for k in eng2sp:\n print("Got key", k)', 'print(list(eng2sp.values()))\n\nprint(list(eng2sp.items()))', 'for (k,v) in eng2sp.items():\n print("Got",k,"that maps to",v)', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\n\nprint(inventory.get("apples"))\nprint(inventory.get("cherries"))\n\nprint(inventory.get("cherries", 0))', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\nprint(\'apples\' in inventory)\nprint(\'cherries\' not in inventory)\n\nif \'bananas\' in inventory:\n print(inventory[\'bananas\'])\nelse:\n print("We have no bananas")', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(35)', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(100)', "get_ipython().run_cell_magic('timeit', '', '\\nfib(100)\\n')", 'def countLetters(text):\n counts = {}\n\n for l in text:\n counts[l] = counts.get(l, 0) + 1\n \n return counts', "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", 'import builtins\nfrom collections import ChainMap\npylookup = ChainMap(locals(), globals(), vars(builtins))\nprint(pylookup)'], '_oh': {2: <IPython.lib.display.IFrame object at 0x7f98f8151400>, 7: True, 10: {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, 20: 9227465, 21: 354224848179261915075}, '_dh': ['/Users/caodg/Workspace/Course/Python/ic/notebooks'], 'In': ['', 'eng2sp = {}\neng2sp["one"] = "uno"\neng2sp["two"] = "dos"\neng2sp["three"] = "tres"\nprint(eng2sp)', 'from IPython.display import IFrame\nIFrame("http://pythontutor.com/iframe-embed.html#code=eng2sp%20%3D%20%7B%7D%0Aeng2sp%5B%22one%22%5D%20%3D%20%22uno%22%0Aeng2sp%5B%22two%22%5D%20%3D%20%22dos%22%0Aeng2sp%5B%22three%22%5D%20%3D%20%22tres%22&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false", width=\'100%\', height=450)', "eng2sp = {'three': 'tres', 'one': 'uno', 'two': 'dos'}\nvalue = eng2sp['two']\nprint(value)", 'd = {"apples": 430, "bananas": 312, \n "oranges": 525, "pears": 217}\n\nl = [(\'apples\', 430), (\'bananas\', 312),\n (\'oranges\', 525), (\'pears\', 217)]', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,[30,40])\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,(30,40))\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', "a = dict(one=1, two=2)\nb = {'one':1, 'two':2}\nc = dict(zip(['one','two'],[1,2]))\nd = dict([('two',2),('one',1)])\ne = dict({'two':2, 'one':1})\na == b == c == d == e", "DIAL_CODES = [\n (86, 'China'),\n (91, 'India'),\n (1, 'United States'),\n (7, 'Russia'),\n (81, 'Japan'),\n (55, 'Brazil'),\n (234, 'Nigeria')\n]", 'country_codes = {country:code for code, country in DIAL_CODES}\nprint(country_codes)', '{code:country.upper() for country, code in country_codes.items() if code < 66}', 'inventory = {"apples": 430, "bananas": 312, "oranges": 525, "pears": 217}\n\ndel inventory["oranges"]\n\nprint(inventory)', 'inventory["pears"] = 0\nprint(inventory)', 'inventory["oranges"] = 0\n\nprint(len(inventory))\nprint(inventory)', 'for k in eng2sp.keys(): \n print("Got key", k, "which maps to value", eng2sp[k])\n\nprint(type(eng2sp.keys()))\nks = list(eng2sp.keys())\nprint(ks)', 'for k in eng2sp:\n print("Got key", k)', 'print(list(eng2sp.values()))\n\nprint(list(eng2sp.items()))', 'for (k,v) in eng2sp.items():\n print("Got",k,"that maps to",v)', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\n\nprint(inventory.get("apples"))\nprint(inventory.get("cherries"))\n\nprint(inventory.get("cherries", 0))', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\nprint(\'apples\' in inventory)\nprint(\'cherries\' not in inventory)\n\nif \'bananas\' in inventory:\n print(inventory[\'bananas\'])\nelse:\n print("We have no bananas")', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(35)', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(100)', "get_ipython().run_cell_magic('timeit', '', '\\nfib(100)\\n')", 'def countLetters(text):\n counts = {}\n\n for l in text:\n counts[l] = counts.get(l, 0) + 1\n \n return counts', "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", 'import builtins\nfrom collections import ChainMap\npylookup = ChainMap(locals(), globals(), vars(builtins))\nprint(pylookup)'], 'Out': {2: <IPython.lib.display.IFrame object at 0x7f98f8151400>, 7: True, 10: {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, 20: 9227465, 21: 354224848179261915075}, 'get_ipython': <bound method InteractiveShell.get_ipython of <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7f9918719b70>>, 'exit': <IPython.core.autocall.ZMQExitAutocall object at 0x7f98e84856a0>, 'quit': <IPython.core.autocall.ZMQExitAutocall object at 0x7f98e84856a0>, '_': 354224848179261915075, '__': 9227465, '___': {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, '_i': "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", '_ii': 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', '_iii': "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", '_i1': 'eng2sp = {}\neng2sp["one"] = "uno"\neng2sp["two"] = "dos"\neng2sp["three"] = "tres"\nprint(eng2sp)', 'eng2sp': {'three': 'tres', 'one': 'uno', 'two': 'dos'}, '_i2': 'from IPython.display import IFrame\nIFrame("http://pythontutor.com/iframe-embed.html#code=eng2sp%20%3D%20%7B%7D%0Aeng2sp%5B%22one%22%5D%20%3D%20%22uno%22%0Aeng2sp%5B%22two%22%5D%20%3D%20%22dos%22%0Aeng2sp%5B%22three%22%5D%20%3D%20%22tres%22&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false", width=\'100%\', height=450)', 'IFrame': <class 'IPython.lib.display.IFrame'>, '_2': <IPython.lib.display.IFrame object at 0x7f98f8151400>, '_i3': "eng2sp = {'three': 'tres', 'one': 'uno', 'two': 'dos'}\nvalue = eng2sp['two']\nprint(value)", 'value': 'dos', '_i4': 'd = {"apples": 430, "bananas": 312, \n "oranges": 525, "pears": 217}\n\nl = [(\'apples\', 430), (\'bananas\', 312),\n (\'oranges\', 525), (\'pears\', 217)]', 'd': {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}, 'l': [('apples', 430), ('bananas', 312), ('oranges', 525), ('pears', 217)], '_i5': '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,[30,40])\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', 't1': (1, 2, (30, 40)), 't2': (1, 2, (30, 40)), '_i6': '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,(30,40))\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', 't3': (1, 2, frozenset({40, 30})), '_i7': "a = dict(one=1, two=2)\nb = {'one':1, 'two':2}\nc = dict(zip(['one','two'],[1,2]))\nd = dict([('two',2),('one',1)])\ne = dict({'two':2, 'one':1})\na == b == c == d == e", 'a': {'one': 1, 'two': 2}, 'b': {'one': 1, 'two': 2}, 'c': {'one': 1, 'two': 2}, 'e': {'two': 2, 'one': 1}, '_7': True, '_i8': "DIAL_CODES = [\n (86, 'China'),\n (91, 'India'),\n (1, 'United States'),\n (7, 'Russia'),\n (81, 'Japan'),\n (55, 'Brazil'),\n (234, 'Nigeria')\n]", 'DIAL_CODES': [(86, 'China'), (91, 'India'), (1, 'United States'), (7, 'Russia'), (81, 'Japan'), (55, 'Brazil'), (234, 'Nigeria')], '_i9': 'country_codes = {country:code for code, country in DIAL_CODES}\nprint(country_codes)', 'country_codes': {'China': 86, 'India': 91, 'United States': 1, 'Russia': 7, 'Japan': 81, 'Brazil': 55, 'Nigeria': 234}, '_i10': '{code:country.upper() for country, code in country_codes.items() if code < 66}', '_10': {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, '_i11': 'inventory = {"apples": 430, "bananas": 312, "oranges": 525, "pears": 217}\n\ndel inventory["oranges"]\n\nprint(inventory)', 'inventory': {'apples': 430, 'bananas': 312, 'oranges': 525, 'pears': 217}, '_i12': 'inventory["pears"] = 0\nprint(inventory)', '_i13': 'inventory["oranges"] = 0\n\nprint(len(inventory))\nprint(inventory)', '_i14': 'for k in eng2sp.keys(): \n print("Got key", k, "which maps to value", eng2sp[k])\n\nprint(type(eng2sp.keys()))\nks = list(eng2sp.keys())\nprint(ks)', 'k': 'two', 'ks': ['three', 'one', 'two'], '_i15': 'for k in eng2sp:\n print("Got key", k)', '_i16': 'print(list(eng2sp.values()))\n\nprint(list(eng2sp.items()))', '_i17': 'for (k,v) in eng2sp.items():\n print("Got",k,"that maps to",v)', 'v': 'dos', '_i18': 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\n\nprint(inventory.get("apples"))\nprint(inventory.get("cherries"))\n\nprint(inventory.get("cherries", 0))', '_i19': 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\nprint(\'apples\' in inventory)\nprint(\'cherries\' not in inventory)\n\nif \'bananas\' in inventory:\n print(inventory[\'bananas\'])\nelse:\n print("We have no bananas")', '_i20': 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(35)', 'alreadyknown': {0: 0, 1: 1, 2: 1, 3: 2, 4: 3, 5: 5, 6: 8, 7: 13, 8: 21, 9: 34, 10: 55, 11: 89, 12: 144, 13: 233, 14: 377, 15: 610, 16: 987, 17: 1597, 18: 2584, 19: 4181, 20: 6765, 21: 10946, 22: 17711, 23: 28657, 24: 46368, 25: 75025, 26: 121393, 27: 196418, 28: 317811, 29: 514229, 30: 832040, 31: 1346269, 32: 2178309, 33: 3524578, 34: 5702887, 35: 9227465, 36: 14930352, 37: 24157817, 38: 39088169, 39: 63245986, 40: 102334155, 41: 165580141, 42: 267914296, 43: 433494437, 44: 701408733, 45: 1134903170, 46: 1836311903, 47: 2971215073, 48: 4807526976, 49: 7778742049, 50: 12586269025, 51: 20365011074, 52: 32951280099, 53: 53316291173, 54: 86267571272, 55: 139583862445, 56: 225851433717, 57: 365435296162, 58: 591286729879, 59: 956722026041, 60: 1548008755920, 61: 2504730781961, 62: 4052739537881, 63: 6557470319842, 64: 10610209857723, 65: 17167680177565, 66: 27777890035288, 67: 44945570212853, 68: 72723460248141, 69: 117669030460994, 70: 190392490709135, 71: 308061521170129, 72: 498454011879264, 73: 806515533049393, 74: 1304969544928657, 75: 2111485077978050, 76: 3416454622906707, 77: 5527939700884757, 78: 8944394323791464, 79: 14472334024676221, 80: 23416728348467685, 81: 37889062373143906, 82: 61305790721611591, 83: 99194853094755497, 84: 160500643816367088, 85: 259695496911122585, 86: 420196140727489673, 87: 679891637638612258, 88: 1100087778366101931, 89: 1779979416004714189, 90: 2880067194370816120, 91: 4660046610375530309, 92: 7540113804746346429, 93: 12200160415121876738, 94: 19740274219868223167, 95: 31940434634990099905, 96: 51680708854858323072, 97: 83621143489848422977, 98: 135301852344706746049, 99: 218922995834555169026, 100: 354224848179261915075}, 'fib': <function fib at 0x7f990853f048>, '_20': 9227465, '_i21': 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(100)', '_21': 354224848179261915075, '_i22': '%%timeit \n\nfib(100)', '_i23': 'def countLetters(text):\n counts = {}\n\n for l in text:\n counts[l] = counts.get(l, 0) + 1\n \n return counts', 'countLetters': <function countLetters at 0x7f99085277b8>, '_i24': "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", 't': 'Such a frequency table might be useful for compressing a text file.', 'counts': {'S': 1, 'u': 4, 'c': 3, 'h': 2, ' ': 11, 'a': 3, 'f': 4, 'r': 3, 'e': 8, 'q': 1, 'n': 2, 'y': 1, 't': 4, 'b': 2, 'l': 3, 'm': 2, 'i': 3, 'g': 2, 's': 3, 'o': 2, 'p': 1, 'x': 1, '.': 1}, '_i25': 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', 'c_items': [(' ', 11), ('.', 1), ('S', 1), ('a', 3), ('b', 2), ('c', 3), ('e', 8), ('f', 4), ('g', 2), ('h', 2), ('i', 3), ('l', 3), ('m', 2), ('n', 2), ('o', 2), ('p', 1), ('q', 1), ('r', 3), ('s', 3), ('t', 4), ('u', 4), ('x', 1), ('y', 1)], '_i26': "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", 'OrderedDict': <class 'collections.OrderedDict'>, '_i27': 'import builtins\nfrom collections import ChainMap\npylookup = ChainMap(locals(), globals(), vars(builtins))\nprint(pylookup)', 'builtins': <module 'builtins' (built-in)>, 'ChainMap': <class 'collections.ChainMap'>, 'pylookup': ...}, {'__name__': '__main__', '__doc__': 'Automatically created module for IPython interactive environment', '__package__': None, '__loader__': None, '__spec__': None, '__builtin__': <module 'builtins' (built-in)>, '__builtins__': <module 'builtins' (built-in)>, '_ih': ['', 'eng2sp = {}\neng2sp["one"] = "uno"\neng2sp["two"] = "dos"\neng2sp["three"] = "tres"\nprint(eng2sp)', 'from IPython.display import IFrame\nIFrame("http://pythontutor.com/iframe-embed.html#code=eng2sp%20%3D%20%7B%7D%0Aeng2sp%5B%22one%22%5D%20%3D%20%22uno%22%0Aeng2sp%5B%22two%22%5D%20%3D%20%22dos%22%0Aeng2sp%5B%22three%22%5D%20%3D%20%22tres%22&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false", width=\'100%\', height=450)', "eng2sp = {'three': 'tres', 'one': 'uno', 'two': 'dos'}\nvalue = eng2sp['two']\nprint(value)", 'd = {"apples": 430, "bananas": 312, \n "oranges": 525, "pears": 217}\n\nl = [(\'apples\', 430), (\'bananas\', 312),\n (\'oranges\', 525), (\'pears\', 217)]', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,[30,40])\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,(30,40))\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', "a = dict(one=1, two=2)\nb = {'one':1, 'two':2}\nc = dict(zip(['one','two'],[1,2]))\nd = dict([('two',2),('one',1)])\ne = dict({'two':2, 'one':1})\na == b == c == d == e", "DIAL_CODES = [\n (86, 'China'),\n (91, 'India'),\n (1, 'United States'),\n (7, 'Russia'),\n (81, 'Japan'),\n (55, 'Brazil'),\n (234, 'Nigeria')\n]", 'country_codes = {country:code for code, country in DIAL_CODES}\nprint(country_codes)', '{code:country.upper() for country, code in country_codes.items() if code < 66}', 'inventory = {"apples": 430, "bananas": 312, "oranges": 525, "pears": 217}\n\ndel inventory["oranges"]\n\nprint(inventory)', 'inventory["pears"] = 0\nprint(inventory)', 'inventory["oranges"] = 0\n\nprint(len(inventory))\nprint(inventory)', 'for k in eng2sp.keys(): \n print("Got key", k, "which maps to value", eng2sp[k])\n\nprint(type(eng2sp.keys()))\nks = list(eng2sp.keys())\nprint(ks)', 'for k in eng2sp:\n print("Got key", k)', 'print(list(eng2sp.values()))\n\nprint(list(eng2sp.items()))', 'for (k,v) in eng2sp.items():\n print("Got",k,"that maps to",v)', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\n\nprint(inventory.get("apples"))\nprint(inventory.get("cherries"))\n\nprint(inventory.get("cherries", 0))', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\nprint(\'apples\' in inventory)\nprint(\'cherries\' not in inventory)\n\nif \'bananas\' in inventory:\n print(inventory[\'bananas\'])\nelse:\n print("We have no bananas")', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(35)', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(100)', "get_ipython().run_cell_magic('timeit', '', '\\nfib(100)\\n')", 'def countLetters(text):\n counts = {}\n\n for l in text:\n counts[l] = counts.get(l, 0) + 1\n \n return counts', "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", 'import builtins\nfrom collections import ChainMap\npylookup = ChainMap(locals(), globals(), vars(builtins))\nprint(pylookup)'], '_oh': {2: <IPython.lib.display.IFrame object at 0x7f98f8151400>, 7: True, 10: {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, 20: 9227465, 21: 354224848179261915075}, '_dh': ['/Users/caodg/Workspace/Course/Python/ic/notebooks'], 'In': ['', 'eng2sp = {}\neng2sp["one"] = "uno"\neng2sp["two"] = "dos"\neng2sp["three"] = "tres"\nprint(eng2sp)', 'from IPython.display import IFrame\nIFrame("http://pythontutor.com/iframe-embed.html#code=eng2sp%20%3D%20%7B%7D%0Aeng2sp%5B%22one%22%5D%20%3D%20%22uno%22%0Aeng2sp%5B%22two%22%5D%20%3D%20%22dos%22%0Aeng2sp%5B%22three%22%5D%20%3D%20%22tres%22&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false", width=\'100%\', height=450)', "eng2sp = {'three': 'tres', 'one': 'uno', 'two': 'dos'}\nvalue = eng2sp['two']\nprint(value)", 'd = {"apples": 430, "bananas": 312, \n "oranges": 525, "pears": 217}\n\nl = [(\'apples\', 430), (\'bananas\', 312),\n (\'oranges\', 525), (\'pears\', 217)]', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,[30,40])\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,(30,40))\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', "a = dict(one=1, two=2)\nb = {'one':1, 'two':2}\nc = dict(zip(['one','two'],[1,2]))\nd = dict([('two',2),('one',1)])\ne = dict({'two':2, 'one':1})\na == b == c == d == e", "DIAL_CODES = [\n (86, 'China'),\n (91, 'India'),\n (1, 'United States'),\n (7, 'Russia'),\n (81, 'Japan'),\n (55, 'Brazil'),\n (234, 'Nigeria')\n]", 'country_codes = {country:code for code, country in DIAL_CODES}\nprint(country_codes)', '{code:country.upper() for country, code in country_codes.items() if code < 66}', 'inventory = {"apples": 430, "bananas": 312, "oranges": 525, "pears": 217}\n\ndel inventory["oranges"]\n\nprint(inventory)', 'inventory["pears"] = 0\nprint(inventory)', 'inventory["oranges"] = 0\n\nprint(len(inventory))\nprint(inventory)', 'for k in eng2sp.keys(): \n print("Got key", k, "which maps to value", eng2sp[k])\n\nprint(type(eng2sp.keys()))\nks = list(eng2sp.keys())\nprint(ks)', 'for k in eng2sp:\n print("Got key", k)', 'print(list(eng2sp.values()))\n\nprint(list(eng2sp.items()))', 'for (k,v) in eng2sp.items():\n print("Got",k,"that maps to",v)', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\n\nprint(inventory.get("apples"))\nprint(inventory.get("cherries"))\n\nprint(inventory.get("cherries", 0))', 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\nprint(\'apples\' in inventory)\nprint(\'cherries\' not in inventory)\n\nif \'bananas\' in inventory:\n print(inventory[\'bananas\'])\nelse:\n print("We have no bananas")', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(35)', 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(100)', "get_ipython().run_cell_magic('timeit', '', '\\nfib(100)\\n')", 'def countLetters(text):\n counts = {}\n\n for l in text:\n counts[l] = counts.get(l, 0) + 1\n \n return counts', "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", 'import builtins\nfrom collections import ChainMap\npylookup = ChainMap(locals(), globals(), vars(builtins))\nprint(pylookup)'], 'Out': {2: <IPython.lib.display.IFrame object at 0x7f98f8151400>, 7: True, 10: {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, 20: 9227465, 21: 354224848179261915075}, 'get_ipython': <bound method InteractiveShell.get_ipython of <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7f9918719b70>>, 'exit': <IPython.core.autocall.ZMQExitAutocall object at 0x7f98e84856a0>, 'quit': <IPython.core.autocall.ZMQExitAutocall object at 0x7f98e84856a0>, '_': 354224848179261915075, '__': 9227465, '___': {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, '_i': "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", '_ii': 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', '_iii': "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", '_i1': 'eng2sp = {}\neng2sp["one"] = "uno"\neng2sp["two"] = "dos"\neng2sp["three"] = "tres"\nprint(eng2sp)', 'eng2sp': {'three': 'tres', 'one': 'uno', 'two': 'dos'}, '_i2': 'from IPython.display import IFrame\nIFrame("http://pythontutor.com/iframe-embed.html#code=eng2sp%20%3D%20%7B%7D%0Aeng2sp%5B%22one%22%5D%20%3D%20%22uno%22%0Aeng2sp%5B%22two%22%5D%20%3D%20%22dos%22%0Aeng2sp%5B%22three%22%5D%20%3D%20%22tres%22&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=0&heapPrimitives=false&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false", width=\'100%\', height=450)', 'IFrame': <class 'IPython.lib.display.IFrame'>, '_2': <IPython.lib.display.IFrame object at 0x7f98f8151400>, '_i3': "eng2sp = {'three': 'tres', 'one': 'uno', 'two': 'dos'}\nvalue = eng2sp['two']\nprint(value)", 'value': 'dos', '_i4': 'd = {"apples": 430, "bananas": 312, \n "oranges": 525, "pears": 217}\n\nl = [(\'apples\', 430), (\'bananas\', 312),\n (\'oranges\', 525), (\'pears\', 217)]', 'd': {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}, 'l': [('apples', 430), ('bananas', 312), ('oranges', 525), ('pears', 217)], '_i5': '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,[30,40])\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', 't1': (1, 2, (30, 40)), 't2': (1, 2, (30, 40)), '_i6': '#Hashable types: str, bytes, int, float, frozenset\nt1 = (1,2,(30,40))\nprint(hash(t1))\n\nt2 = (1,2,(30,40))\nprint(hash(t2))\n\nt3 = (1,2,frozenset([30,40]))\nprint(hash(t3))', 't3': (1, 2, frozenset({40, 30})), '_i7': "a = dict(one=1, two=2)\nb = {'one':1, 'two':2}\nc = dict(zip(['one','two'],[1,2]))\nd = dict([('two',2),('one',1)])\ne = dict({'two':2, 'one':1})\na == b == c == d == e", 'a': {'one': 1, 'two': 2}, 'b': {'one': 1, 'two': 2}, 'c': {'one': 1, 'two': 2}, 'e': {'two': 2, 'one': 1}, '_7': True, '_i8': "DIAL_CODES = [\n (86, 'China'),\n (91, 'India'),\n (1, 'United States'),\n (7, 'Russia'),\n (81, 'Japan'),\n (55, 'Brazil'),\n (234, 'Nigeria')\n]", 'DIAL_CODES': [(86, 'China'), (91, 'India'), (1, 'United States'), (7, 'Russia'), (81, 'Japan'), (55, 'Brazil'), (234, 'Nigeria')], '_i9': 'country_codes = {country:code for code, country in DIAL_CODES}\nprint(country_codes)', 'country_codes': {'China': 86, 'India': 91, 'United States': 1, 'Russia': 7, 'Japan': 81, 'Brazil': 55, 'Nigeria': 234}, '_i10': '{code:country.upper() for country, code in country_codes.items() if code < 66}', '_10': {1: 'UNITED STATES', 7: 'RUSSIA', 55: 'BRAZIL'}, '_i11': 'inventory = {"apples": 430, "bananas": 312, "oranges": 525, "pears": 217}\n\ndel inventory["oranges"]\n\nprint(inventory)', 'inventory': {'apples': 430, 'bananas': 312, 'oranges': 525, 'pears': 217}, '_i12': 'inventory["pears"] = 0\nprint(inventory)', '_i13': 'inventory["oranges"] = 0\n\nprint(len(inventory))\nprint(inventory)', '_i14': 'for k in eng2sp.keys(): \n print("Got key", k, "which maps to value", eng2sp[k])\n\nprint(type(eng2sp.keys()))\nks = list(eng2sp.keys())\nprint(ks)', 'k': 'two', 'ks': ['three', 'one', 'two'], '_i15': 'for k in eng2sp:\n print("Got key", k)', '_i16': 'print(list(eng2sp.values()))\n\nprint(list(eng2sp.items()))', '_i17': 'for (k,v) in eng2sp.items():\n print("Got",k,"that maps to",v)', 'v': 'dos', '_i18': 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\n\nprint(inventory.get("apples"))\nprint(inventory.get("cherries"))\n\nprint(inventory.get("cherries", 0))', '_i19': 'inventory = {\'apples\': 430, \'bananas\': 312, \'oranges\': 525, \'pears\': 217}\nprint(\'apples\' in inventory)\nprint(\'cherries\' not in inventory)\n\nif \'bananas\' in inventory:\n print(inventory[\'bananas\'])\nelse:\n print("We have no bananas")', '_i20': 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(35)', 'alreadyknown': {0: 0, 1: 1, 2: 1, 3: 2, 4: 3, 5: 5, 6: 8, 7: 13, 8: 21, 9: 34, 10: 55, 11: 89, 12: 144, 13: 233, 14: 377, 15: 610, 16: 987, 17: 1597, 18: 2584, 19: 4181, 20: 6765, 21: 10946, 22: 17711, 23: 28657, 24: 46368, 25: 75025, 26: 121393, 27: 196418, 28: 317811, 29: 514229, 30: 832040, 31: 1346269, 32: 2178309, 33: 3524578, 34: 5702887, 35: 9227465, 36: 14930352, 37: 24157817, 38: 39088169, 39: 63245986, 40: 102334155, 41: 165580141, 42: 267914296, 43: 433494437, 44: 701408733, 45: 1134903170, 46: 1836311903, 47: 2971215073, 48: 4807526976, 49: 7778742049, 50: 12586269025, 51: 20365011074, 52: 32951280099, 53: 53316291173, 54: 86267571272, 55: 139583862445, 56: 225851433717, 57: 365435296162, 58: 591286729879, 59: 956722026041, 60: 1548008755920, 61: 2504730781961, 62: 4052739537881, 63: 6557470319842, 64: 10610209857723, 65: 17167680177565, 66: 27777890035288, 67: 44945570212853, 68: 72723460248141, 69: 117669030460994, 70: 190392490709135, 71: 308061521170129, 72: 498454011879264, 73: 806515533049393, 74: 1304969544928657, 75: 2111485077978050, 76: 3416454622906707, 77: 5527939700884757, 78: 8944394323791464, 79: 14472334024676221, 80: 23416728348467685, 81: 37889062373143906, 82: 61305790721611591, 83: 99194853094755497, 84: 160500643816367088, 85: 259695496911122585, 86: 420196140727489673, 87: 679891637638612258, 88: 1100087778366101931, 89: 1779979416004714189, 90: 2880067194370816120, 91: 4660046610375530309, 92: 7540113804746346429, 93: 12200160415121876738, 94: 19740274219868223167, 95: 31940434634990099905, 96: 51680708854858323072, 97: 83621143489848422977, 98: 135301852344706746049, 99: 218922995834555169026, 100: 354224848179261915075}, 'fib': <function fib at 0x7f990853f048>, '_20': 9227465, '_i21': 'alreadyknown = {0: 0, 1: 1}\n\ndef fib(n):\n if n not in alreadyknown:\n new_value = fib(n-1) + fib(n-2)\n alreadyknown[n] = new_value\n return alreadyknown[n]\n\nfib(100)', '_21': 354224848179261915075, '_i22': '%%timeit \n\nfib(100)', '_i23': 'def countLetters(text):\n counts = {}\n\n for l in text:\n counts[l] = counts.get(l, 0) + 1\n \n return counts', 'countLetters': <function countLetters at 0x7f99085277b8>, '_i24': "t = 'Such a frequency table might be useful for compressing a text file.'\n\ncounts = countLetters(t)\n\nprint(counts)", 't': 'Such a frequency table might be useful for compressing a text file.', 'counts': {'S': 1, 'u': 4, 'c': 3, 'h': 2, ' ': 11, 'a': 3, 'f': 4, 'r': 3, 'e': 8, 'q': 1, 'n': 2, 'y': 1, 't': 4, 'b': 2, 'l': 3, 'm': 2, 'i': 3, 'g': 2, 's': 3, 'o': 2, 'p': 1, 'x': 1, '.': 1}, '_i25': 'c_items = list(counts.items())\nc_items.sort()\nprint(c_items)', 'c_items': [(' ', 11), ('.', 1), ('S', 1), ('a', 3), ('b', 2), ('c', 3), ('e', 8), ('f', 4), ('g', 2), ('h', 2), ('i', 3), ('l', 3), ('m', 2), ('n', 2), ('o', 2), ('p', 1), ('q', 1), ('r', 3), ('s', 3), ('t', 4), ('u', 4), ('x', 1), ('y', 1)], '_i26': "from collections import OrderedDict\n# regular unsorted dictionary\nd = {'banana': 3, 'apple': 4, 'pear': 1, 'orange': 2}\n\n# dictionary sorted by key\nprint(OrderedDict(sorted(d.items(), key=lambda t: t[0])))\n\n# dictionary sorted by value\nprint( OrderedDict(sorted(d.items(), key=lambda t: t[1])))\n\n# dictionary sorted by length of the key string\nprint( OrderedDict(sorted(d.items(), key=lambda t: len(t[0]))))", 'OrderedDict': <class 'collections.OrderedDict'>, '_i27': 'import builtins\nfrom collections import ChainMap\npylookup = ChainMap(locals(), globals(), vars(builtins))\nprint(pylookup)', 'builtins': <module 'builtins' (built-in)>, 'ChainMap': <class 'collections.ChainMap'>, 'pylookup': ...}, {'__name__': 'builtins', '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", '__package__': '', '__loader__': <class '_frozen_importlib.BuiltinImporter'>, '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>), '__build_class__': <built-in function __build_class__>, '__import__': <built-in function __import__>, 'abs': <built-in function abs>, 'all': <built-in function all>, 'any': <built-in function any>, 'ascii': <built-in function ascii>, 'bin': <built-in function bin>, 'breakpoint': <built-in function breakpoint>, 'callable': <built-in function callable>, 'chr': <built-in function chr>, 'compile': <built-in function compile>, 'delattr': <built-in function delattr>, 'dir': <built-in function dir>, 'divmod': <built-in function divmod>, 'eval': <built-in function eval>, 'exec': <built-in function exec>, 'format': <built-in function format>, 'getattr': <built-in function getattr>, 'globals': <built-in function globals>, 'hasattr': <built-in function hasattr>, 'hash': <built-in function hash>, 'hex': <built-in function hex>, 'id': <built-in function id>, 'input': <bound method Kernel.raw_input of <ipykernel.ipkernel.IPythonKernel object at 0x7f98e83f5dd8>>, 'isinstance': <built-in function isinstance>, 'issubclass': <built-in function issubclass>, 'iter': <built-in function iter>, 'len': <built-in function len>, 'locals': <built-in function locals>, 'max': <built-in function max>, 'min': <built-in function min>, 'next': <built-in function next>, 'oct': <built-in function oct>, 'ord': <built-in function ord>, 'pow': <built-in function pow>, 'print': <built-in function print>, 'repr': <built-in function repr>, 'round': <built-in function round>, 'setattr': <built-in function setattr>, 'sorted': <built-in function sorted>, 'sum': <built-in function sum>, 'vars': <built-in function vars>, 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': <class 'bool'>, 'memoryview': <class 'memoryview'>, 'bytearray': <class 'bytearray'>, 'bytes': <class 'bytes'>, 'classmethod': <class 'classmethod'>, 'complex': <class 'complex'>, 'dict': <class 'dict'>, 'enumerate': <class 'enumerate'>, 'filter': <class 'filter'>, 'float': <class 'float'>, 'frozenset': <class 'frozenset'>, 'property': <class 'property'>, 'int': <class 'int'>, 'list': <class 'list'>, 'map': <class 'map'>, 'object': <class 'object'>, 'range': <class 'range'>, 'reversed': <class 'reversed'>, 'set': <class 'set'>, 'slice': <class 'slice'>, 'staticmethod': <class 'staticmethod'>, 'str': <class 'str'>, 'super': <class 'super'>, 'tuple': <class 'tuple'>, 'type': <class 'type'>, 'zip': <class 'zip'>, '__debug__': True, 'BaseException': <class 'BaseException'>, 'Exception': <class 'Exception'>, 'TypeError': <class 'TypeError'>, 'StopAsyncIteration': <class 'StopAsyncIteration'>, 'StopIteration': <class 'StopIteration'>, 'GeneratorExit': <class 'GeneratorExit'>, 'SystemExit': <class 'SystemExit'>, 'KeyboardInterrupt': <class 'KeyboardInterrupt'>, 'ImportError': <class 'ImportError'>, 'ModuleNotFoundError': <class 'ModuleNotFoundError'>, 'OSError': <class 'OSError'>, 'EnvironmentError': <class 'OSError'>, 'IOError': <class 'OSError'>, 'EOFError': <class 'EOFError'>, 'RuntimeError': <class 'RuntimeError'>, 'RecursionError': <class 'RecursionError'>, 'NotImplementedError': <class 'NotImplementedError'>, 'NameError': <class 'NameError'>, 'UnboundLocalError': <class 'UnboundLocalError'>, 'AttributeError': <class 'AttributeError'>, 'SyntaxError': <class 'SyntaxError'>, 'IndentationError': <class 'IndentationError'>, 'TabError': <class 'TabError'>, 'LookupError': <class 'LookupError'>, 'IndexError': <class 'IndexError'>, 'KeyError': <class 'KeyError'>, 'ValueError': <class 'ValueError'>, 'UnicodeError': <class 'UnicodeError'>, 'UnicodeEncodeError': <class 'UnicodeEncodeError'>, 'UnicodeDecodeError': <class 'UnicodeDecodeError'>, 'UnicodeTranslateError': <class 'UnicodeTranslateError'>, 'AssertionError': <class 'AssertionError'>, 'ArithmeticError': <class 'ArithmeticError'>, 'FloatingPointError': <class 'FloatingPointError'>, 'OverflowError': <class 'OverflowError'>, 'ZeroDivisionError': <class 'ZeroDivisionError'>, 'SystemError': <class 'SystemError'>, 'ReferenceError': <class 'ReferenceError'>, 'MemoryError': <class 'MemoryError'>, 'BufferError': <class 'BufferError'>, 'Warning': <class 'Warning'>, 'UserWarning': <class 'UserWarning'>, 'DeprecationWarning': <class 'DeprecationWarning'>, 'PendingDeprecationWarning': <class 'PendingDeprecationWarning'>, 'SyntaxWarning': <class 'SyntaxWarning'>, 'RuntimeWarning': <class 'RuntimeWarning'>, 'FutureWarning': <class 'FutureWarning'>, 'ImportWarning': <class 'ImportWarning'>, 'UnicodeWarning': <class 'UnicodeWarning'>, 'BytesWarning': <class 'BytesWarning'>, 'ResourceWarning': <class 'ResourceWarning'>, 'ConnectionError': <class 'ConnectionError'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, 'ConnectionRefusedError': <class 'ConnectionRefusedError'>, 'ConnectionResetError': <class 'ConnectionResetError'>, 'FileExistsError': <class 'FileExistsError'>, 'FileNotFoundError': <class 'FileNotFoundError'>, 'IsADirectoryError': <class 'IsADirectoryError'>, 'NotADirectoryError': <class 'NotADirectoryError'>, 'InterruptedError': <class 'InterruptedError'>, 'PermissionError': <class 'PermissionError'>, 'ProcessLookupError': <class 'ProcessLookupError'>, 'TimeoutError': <class 'TimeoutError'>, 'open': <built-in function open>, 'copyright': Copyright (c) 2001-2018 Python Software Foundation.
All Rights Reserved.
Copyright (c) 2000 BeOpen.com.
All Rights Reserved.
Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.
Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object., '__IPYTHON__': True, 'display': <function display at 0x7f990824ac80>, 'get_ipython': <bound method InteractiveShell.get_ipython of <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7f9918719b70>>})