python

Functions

Advanced Function Concepts in Python: Examples, Uses and Application

Introduction: Advanced Function Concepts in Python Python functions can do much more than simply accept arguments and return values. As programs become more complex, functions can be stored in variables, passed to other functions, returned from functions, and used to preserve information between calls. These features make Python functions flexible and powerful. They are also […]

Advanced Function Concepts in Python: Examples, Uses and Application Read Post »

Functions

Variable Scope Concepts in Python: Important Concepts and Differences

Introduction: Variable Scope Concepts in Python Some variable scope concepts in Python apply to more than one topic, such as local variables, global variables, and the global keyword. These shared concepts are collected on this page so the same explanation does not need to be repeated across multiple tutorials. Quick Navigation Local and Global Variables

Variable Scope Concepts in Python: Important Concepts and Differences Read Post »

Functions

Python nonlocal Keyword: Syntax, Uses, Examples and Common Mistakes

Before learning the nonlocal keyword, let’s understand what an enclosing function is. What Is an Enclosing Function? When a function is defined inside another function, the outer function is called the enclosing function and the function defined inside it is called the nested function. def outer(): # Enclosing function def inner(): # Nested function print(“Hello”)

Python nonlocal Keyword: Syntax, Uses, Examples and Common Mistakes Read Post »

argument-unpacking

Python Multiple Argument Unpacking: Using * and ** Together

Introduction: Python Multiple Argument Unpacking Sometimes the values needed by a function are stored in more than one list, tuple, or dictionary. Passing every value separately can make the function call longer, especially when the values are already grouped into different collections. Python provides a simpler way to handle this situation. Python multiple argument unpacking

Python Multiple Argument Unpacking: Using * and ** Together Read Post »

argument-unpacking

Python Argument Unpacking With Positional-Only and Keyword-Only Parameters: Rules and Examples

Introduction: Python Argument Unpacking With Positional-Only and Keyword-Only Parameters Python Argument Unpacking With Positional-Only and Keyword-Only Parameters is useful when you need to control how unpacked values are passed to function parameters. These parameter restrictions determine whether an argument must be passed by position or by keyword. When argument unpacking is used with these parameters,

Python Argument Unpacking With Positional-Only and Keyword-Only Parameters: Rules and Examples Read Post »

Scroll to Top