Ned Batchelder at 2016/11/15 6:33:54AM wrote: > > But I get a wrong answer this way: > > >>> from deen import * > > >>> tblm = tbli > > >>> gpa(0x7d) > > 125 # it's 0x7d, the tblm[2] is 0 > > > > Why? why! why:-( > > Here you are assigning a value to your own tblm, not deen.tblm, > so gpa does not see the new value. > Hi Ned, below is the capture of my terminal screen:
D:\Temp>python Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> dir() ['__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__'] >>> from deen import * >>> dir() ['__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'gpa', 'tbli', 'tblm'] >>> tblm [0, 0, 0] >>> tblm=tbli >>> tblm [102, 39, 208] >>> dir() ['__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'gpa', 'tbli', 'tblm'] >>> Do you mean the last 'tblm' is my own? How it can be? The 'tblm' already exist before the assignment and this assignment shouldn't create a new one, right? and how do I assign the 'deen.tblm' under this circumstance? --Jach -- https://mail.python.org/mailman/listinfo/python-list