Python notes #3 (functions)

local – Variables defined inside a function or a block are local to that function or block.
global – Variables defined at the top level of a module or file are global. global keyword is used to declare a variable that is defined outside of a function (i.e., in the global scope) and make it accessible within a function
nonlocal – Used inside nested functions to refer to variables in the nearest enclosing function (but not global).

recursive functions – calculating factorial, fibonacci

原文链接:Python notes #3 (functions)

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
things never change, we change.
世界并没有变,改变的是我们
评论 抢沙发

请登录后发表评论

    暂无评论内容