{'_dh': [u'/home/tcloudost/Documents/git_repositories/python-batches/batch-58'], '__': '', 'my_new': <function my_new at 0x7fa7928a8140>, '_i': u'x = 10\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x', 'quit': <IPython.core.autocall.ZMQExitAutocall object at 0x7fa78c3e1290>, '__builtins__': <module '__builtin__' (built-in)>, '_ih': ['', u'# function\ndef my_fun():\n print "hello world"', u'my_fun2()', u'print my_fun()', u'# function\ndef my_fun():\n print "hello world"\n \ndef my_func():\n return "hello world"', u'print my_func()', u'# function\ndef my_fun():\n print "hello world"\n \ndef my_func():\n return "hello world"\n print "how are you"\n print "what are you doing"', u'# If you have a return value in a function, that is the last statement to be executed in function.\n# return is not a print statement.\n# it marks end of the function.\nprint my_func()', u'print type(my_func)', u'print type(my_func)\nprint my_func', u'print type(my_func)\nprint my_func\nmy_func', u'# scope\n# localscope and global scope.\n\ndef my_new():\n a = 1\n return a\n\nprint my_new() # 1\nprint a # 1,error', u'# scope\n# local scope/namespace and global scope/namespace.\n# values defined inside a function are restricted to the function.\n# life space of a variable is during the runtime of the function.\n# locals\n\ndef my_new():\n a = 1\n print locals()\n return a\n\nprint my_new() # 1\nprint a # 1,error', u'x = 10\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x', u'x = 10 # global variable\nprint globals()\n\n\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x'], '__builtin__': <module '__builtin__' (built-in)>, '_10': <function my_func at 0x7fa78c28ae60>, 'my_new1': <function my_new1 at 0x7fa78c28acf8>, '__name__': '__main__', '___': '', '_': <function my_func at 0x7fa78c28ae60>, '_sh': <module 'IPython.core.shadowns' from '/usr/local/lib/python2.7/dist-packages/IPython/core/shadowns.pyc'>, 'my_fun': <function my_fun at 0x7fa78c2f2f50>, '_i11': u'# scope\n# localscope and global scope.\n\ndef my_new():\n a = 1\n return a\n\nprint my_new() # 1\nprint a # 1,error', '_i9': u'print type(my_func)\nprint my_func', '_i8': u'print type(my_func)', '_i7': u'# If you have a return value in a function, that is the last statement to be executed in function.\n# return is not a print statement.\n# it marks end of the function.\nprint my_func()', '_i6': u'# function\ndef my_fun():\n print "hello world"\n \ndef my_func():\n return "hello world"\n print "how are you"\n print "what are you doing"', '_i5': u'print my_func()', '_i4': u'# function\ndef my_fun():\n print "hello world"\n \ndef my_func():\n return "hello world"', '_i3': u'print my_fun()', '_i2': u'my_fun2()', '_i1': u'# function\ndef my_fun():\n print "hello world"', '__doc__': 'Automatically created module for IPython interactive environment', '_i13': u'x = 10\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x', 'my_func': <function my_func at 0x7fa78c28ae60>, '_iii': u'# scope\n# localscope and global scope.\n\ndef my_new():\n a = 1\n return a\n\nprint my_new() # 1\nprint a # 1,error', '_i10': u'print type(my_func)\nprint my_func\nmy_func', 'exit': <IPython.core.autocall.ZMQExitAutocall object at 0x7fa78c3e1290>, 'get_ipython': <bound method ZMQInteractiveShell.get_ipython of <ipykernel.zmqshell.ZMQInteractiveShell object at 0x7fa795044950>>, '_ii': u'# scope\n# local scope/namespace and global scope/namespace.\n# values defined inside a function are restricted to the function.\n# life space of a variable is during the runtime of the function.\n# locals\n\ndef my_new():\n a = 1\n print locals()\n return a\n\nprint my_new() # 1\nprint a # 1,error', 'In': ['', u'# function\ndef my_fun():\n print "hello world"', u'my_fun2()', u'print my_fun()', u'# function\ndef my_fun():\n print "hello world"\n \ndef my_func():\n return "hello world"', u'print my_func()', u'# function\ndef my_fun():\n print "hello world"\n \ndef my_func():\n return "hello world"\n print "how are you"\n print "what are you doing"', u'# If you have a return value in a function, that is the last statement to be executed in function.\n# return is not a print statement.\n# it marks end of the function.\nprint my_func()', u'print type(my_func)', u'print type(my_func)\nprint my_func', u'print type(my_func)\nprint my_func\nmy_func', u'# scope\n# localscope and global scope.\n\ndef my_new():\n a = 1\n return a\n\nprint my_new() # 1\nprint a # 1,error', u'# scope\n# local scope/namespace and global scope/namespace.\n# values defined inside a function are restricted to the function.\n# life space of a variable is during the runtime of the function.\n# locals\n\ndef my_new():\n a = 1\n print locals()\n return a\n\nprint my_new() # 1\nprint a # 1,error', u'x = 10\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x', u'x = 10 # global variable\nprint globals()\n\n\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x'], '_i12': u'# scope\n# local scope/namespace and global scope/namespace.\n# values defined inside a function are restricted to the function.\n# life space of a variable is during the runtime of the function.\n# locals\n\ndef my_new():\n a = 1\n print locals()\n return a\n\nprint my_new() # 1\nprint a # 1,error', 'x': 10, '_i14': u'x = 10 # global variable\nprint globals()\n\n\ndef my_new1():\n print locals()\n return x\n\nprint my_new1()\nprint x', '_oh': {10: <function my_func at 0x7fa78c28ae60>}, 'Out': {10: <function my_func at 0x7fa78c28ae60>}}
{}
10
10