首页 > 编程语言 > 详细

python-嵌套函数

时间:2019-12-08 11:15:39      阅读:108      评论:0      收藏:0      [点我收藏+]
                            python-嵌套函数

定义:在函数体内用def定义一个函数,它的作用域只在该函数体内有效。
def outside():
    print("int the outside")
    def  inside():
         print("in the inside")
    inside()
outside()


打印结果
int the outside
in the inside

 

 

python-嵌套函数

原文:https://www.cnblogs.com/kezi/p/12004204.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!