DEV Community

Alvin Seyidov
Alvin Seyidov

Posted on

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

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay