COURSE SECTION 04 OF 06
Python Functions, Arguments and Scope
Lesson material assembled from the files you supplied.
Course notes
Content below is transcribed from the supplied course document. The original wording and terminology are retained.
What is a Function?
Use def keyword
Defining a Python function
Function with positional arguments
Function with the argument and return value
Function with default argument
Function with variable-length arguments
Function with keyworded arguments
Argument pass by reference or value
Scope:-
Types of Scope:-
Local Scope
Enclosing Scope
Global Scope
Built-in Scope
Memory management
Scope of variables:-
Local variables
Global variables
Download the supplied Python examples
Topics identified in the course materials
- What is a Function?
- Defining a Function with def
- Positional and Keyword Arguments
- Return Values and Default Arguments
- Variable-Length Arguments
- Scope: Local, Enclosing, Global and Built-in