python函数嵌套的实用技术

def fun():
    def fun1():
        print (99)
    fun1()
fun()
fun1()#总结老男孩python里面讲过,这个是函数的嵌套,很有用,
#效果就是给函数一个自己的小函数.然后外面没法调用,这样避免了重名.
View Code

 

posted on 2018-03-20 15:45  张博的博客  阅读(108)  评论(0编辑  收藏  举报

导航