1/20
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Function
A named block of code that performs a specific task.;
def
Keyword used to define a function.;
Function call
Tells Python to execute a function.;
Parameter
A variable in a function definition that receives a value.;
Argument
A value passed to a function when it is called.;
return
Sends a value from a function back to the code that called it.;
main()
Function used to organize the main flow of a program.;
if name == "main":
Checks whether the file is being run as the main program before calling main().;
Default value
A parameter value automatically used if an argument is not supplied.;
Named argument
Passes an argument by specifying the parameter's name.;
Positional argument
An argument matched to a parameter based on its position.;
Local variable
A variable defined inside a function and usable only within that function.;
Global variable
A variable defined outside functions that has global scope.;
Shadow variable
A local variable with the same name as a global variable; recommended to avoid.;
Module
A file containing Python code, such as functions, that can be imported.;
import
Makes another module available to the current program.;
Namespace
Space that stores the names and functions associated with a module.;
import module as name
Imports a module using a different namespace name.;
from module import function
Imports a specific function into the global namespace.;
Name collision
Occurs when imported items have the same name and interfere with one another.;
Hierarchy chart
Diagram showing how a program is divided into functions, beginning with main().;