A newbie quesiton: local variable in a nested funciton

jfong at ms4.hinet.net jfong at ms4.hinet.net
Sat Dec 26 23:05:44 EST 2015


Chris Angelico at 2015/12/26  UTC+8 5:50:07PM wrote:
> 11: Another normal assignment, because otherwise the rest of the work
> is pointless. :)

Thanks for this detailed example. As I had learned so far, Python really take "name" seriously, and every meaningful result you got have to assign to a name at last. This morning I played some codes on the http://pythonturor.com and found out that every objects which was not created at top-level of a module or in a class will disappear after import. A very "unusual" view. 

> Python's flexibility and simplicity are a huge part of why I love the
> language so much.

simplicity? Maybe because you are soooo familiar with Python. It's not to me, at least at this moment. Please see my next question follows.

--Jach



More information about the Python-list mailing list