python一段代码 感受一下

 

class T():
    def aa(self):
        write = 1
        print '123'
       

 

        class B():
            def hehe(self):
                print write

        c = B()
        c.hehe()

 

 


a = T()
a.aa()

 

 

 

输出:

123

1

posted @ 2016-02-07 13:16  elliottc  阅读(266)  评论(0编辑  收藏  举报