1/13
Looks like no tags are added yet.
Don't Repeat Yourself (DRY)
A principle of software engineering aimed at making it easier to maintain, update, and debug code.
Functions
Named containers for statements that can be invoked to execute code, improving readability and reducing repetition.
Built-in functions
Functions like print(), len(), and type() that come with Python and can be called without being defined first.
Docstring
A string written on the first line of a function's body that describes what the function does, shown by help() and in VS Code.
Parameters
Placeholders for inputs given to the function that can change the function's behavior.
Arguments
The actual values provided when invoking a function.
Return statements
Allow functions to produce values for use elsewhere in the program and terminate function execution.
Default values
Parameters can have these, allowing flexibility in how functions are called.
Keyword arguments
Allow arguments to be passed by name instead of by position.
NameError
Raised when a line uses a name that does not exist, often due to misspelling or scope issues.
TypeError
Raised when a value is the wrong type for what is requested in the code, or when incorrect arguments are given to a function.
Scope
Determines where variables can be accessed; includes global and local scopes.
Global scope
The file outside of any function, where variables are reachable anywhere in that file.
Local scope
The inside of a function, where variables exist only while the function is running.