{'__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': ['', "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n print(name)\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", 'len', "name = 'this is a global name'\n\ndef greet(name):\n print('name')\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print('name')\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "name = 'this is a global name'\n\ndef greet():\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "x = 50\n\ndef fun():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\n\ndef func():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\n\ndef func():\n print(globals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\nprint(locals())\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)"], '_oh': {4: <built-in function len>}, '_dh': ['C:\\Users\\richa\\Portable Apps\\WinPython-64bit-3.6.1.0Qt5\\notebooks\\Python-Bootcamp_my_code'], '_sh': <module 'IPython.core.shadowns' from 'C:\\Users\\richa\\Portable Apps\\WinPython-64bit-3.6.1.0Qt5\\python-3.6.1.amd64\\lib\\site-packages\\IPython\\core\\shadowns.py'>, 'In': ['', "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n print(name)\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", 'len', "name = 'this is a global name'\n\ndef greet(name):\n print('name')\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print('name')\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "name = 'this is a global name'\n\ndef greet():\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", "x = 50\n\ndef fun():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\n\ndef func():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\n\ndef func():\n print(globals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", "x = 50\nprint(locals())\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)"], 'Out': {4: <built-in function len>}, 'get_ipython': <bound method InteractiveShell.get_ipython of <ipykernel.zmqshell.ZMQInteractiveShell object at 0x00000216B15F5860>>, 'exit': <IPython.core.autocall.ZMQExitAutocall object at 0x00000216B16FB7F0>, 'quit': <IPython.core.autocall.ZMQExitAutocall object at 0x00000216B16FB7F0>, '_': <built-in function len>, '__': '', '___': '', '_i': "x = 50\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", '_ii': "x = 50\n\ndef func():\n print(globals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", '_iii': "x = 50\n\ndef func():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", '_i1': "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", 'name': 'this is a global name', 'greet': <function greet at 0x00000216B2860EA0>, '_i2': "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n print(name)\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", '_i3': "name = 'this is a global name'\n\ndef greet():\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", '_i4': 'len', '_4': <built-in function len>, '_i5': "name = 'this is a global name'\n\ndef greet(name):\n print('name')\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", '_i6': "name = 'this is a global name'\n\ndef greet(name):\n print('name')\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", '_i7': "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", '_i8': "name = 'this is a global name'\n\ndef greet():\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", '_i9': "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet()\nprint(name)", '_i10': "name = 'this is a global name'\n\ndef greet(name):\n print(name)\n # enclosing function\n name = 'sammy'\n \n def hello():\n print('hello'+name)\n \n hello()\ngreet(name)\nprint(name)", '_i11': "x = 50\n\ndef fun():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", 'x': 50, 'fun': <function fun at 0x00000216B28171E0>, '_i12': "x = 50\n\ndef func():\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", 'func': <function func at 0x00000216B28600D0>, '_i13': "x = 50\n\ndef func():\n print(globals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", '_i14': "x = 50\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)", '_i15': "x = 50\nprint(locals())\n\ndef func():\n print(locals())\n global x\n print('this function is now using the global x!')\n print('because of global x is: ', x)\n x = 2\n print('ran func(), changed global x to',x)\n \nprint('before calling func(), x is: ', x)\nfunc()\nprint('value of x (outside of func()) is: ', x)"}
before calling func(), x is: 50
{}
this function is now using the global x!
because of global x is: 50
ran func(), changed global x to 2
value of x (outside of func()) is: 2