1/29
Comprehensive vocabulary flashcards covering Python functions, function stubs, parameters, typing systems, scopes, and namespaces from Chapter 6.
Function
A named series of predefined statements grouped together to perform repeated operations, reducing program redundancy and keeping the main program simple.
Function Definition
A statement block beginning with the def keyword and the function's name, followed by an indented body of statements that define the function's behavior.
Function Call
An invocation of a function's name that causes the program execution to jump to the function's statements and return after executing the last statement.
Parameter
A function input specified within the parentheses of a function definition, which is bound to an argument value when the function is called.
Argument
A specific value or expression passed to a function's parameter during a function call.
None
A special Python keyword that indicates no value, which is returned by default when a function contains no return statement or an empty return statement.
Hierarchical Function Call
A nested call where a function's statements include calls to other functions, or where a function call serves as an argument to another function (such as in int(input())).
Void Function
A function that performs an action (such as printing output) without returning a value, implicitly returning None.
Polymorphism
The behavior in which an operation or function depends on the involved object types, such as the + operator performing addition for numbers and concatenation for strings.
Dynamic Typing
A programming language feature where the interpreter determines object types during program execution and checks operation validity at runtime.
Static Typing
A programming language requirement (found in languages like C, C++, and Java) where the programmer must explicitly declare the type of every variable and parameter in the source code prior to compilation.
Duck Typing
A form of dynamic typing based on the maxim 'If a bird walks, swims, and quacks like a duck, then call it a duck,' treating an object based on the operations it supports rather than its declared class.
Modular Development
The process of dividing a program into separate modules or functions that can be written, tested individually, and integrated into a single system.
Mathematical Function
A function that executes a mathematical calculation involving one or more numerical parameters and returns a numerical result.
Incremental Development
A programming practice where a small amount of code is written and tested, followed by writing and testing additional small increments until completion.
Function Stub
A placeholder function definition whose statements have not yet been written, used to capture high-level program behavior during early development.
pass Statement
A Python keyword that performs no operation, serving as a syntactic placeholder where a code statement is required.
NotImplementedError
An exception raised in an unfinished function stub to immediately stop program execution when that stub is invoked.
Function Object
An entity created when a def statement is evaluated, possessing a type, identity, value, and compiled bytecode that supports the call operation.
Bytecode
Low-level operations generated by the Python interpreter when evaluating code, representing instructions like loading, adding, or storing values in memory.
Copy-Paste Error
A common mistake occurring when existing code is copied into a new function but the programmer fails to adjust all variable names, formulas, or return statements.
Scope
The specific area or portion of program code where a variable or function name is visible and accessible.
Local Variable
A variable defined inside a function whose visibility extends only from its first assignment to the end of that function.
Global Variable
A variable defined outside of any function whose visibility extends from its assignment to the end of the file.
global Statement
A Python statement required inside a function to permit assigning or re-binding a global variable rather than creating a local variable.
Namespace
An internal mapping structure (implemented as a Python dictionary) that tracks program objects by linking names to their corresponding values.
locals()
A built-in Python function that returns a dictionary containing all the names and objects located in the current local namespace.
globals()
A built-in Python function that returns a dictionary containing all the names and objects located in the global namespace.
Scope Resolution
The sequential process by which the Python interpreter searches through active namespaces (local, enclosing, global, and built-in) to find a referenced name.
Built-in Scope
The outermost scope that contains all pre-defined Python functions and constants, such as int(), input(), and str().