1/21
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Class
A blueprint defining attributes and methods for objects.
Object (Instance)
Concrete creation from a class with unique attribute values.
__init__
(Constructor)
Special method called when creating an object to initialize attributes.
self
Parameter
Reference to the current object instance, allowing access to its attributes.
Attributes
Variables owned by an object, defined in the constructor using self.attribute
Base Case
Condition where recursion stops, preventing further calls.
Recursive Case
Function calls itself with modified arguments to progress toward the base case.
Linked List
A recursive data structure where each Node
points to the next node or None
.
Recursive Traversal
A process where the current node is handled before recursively processing the next
node.
Abstraction
Hiding complex implementation while exposing essential features.
Instantiation
Creating an object from a class, triggering the __init__
method.
Stack Frame
Memory space for a function call, created during recursion.
RecursionError
Occurs if the base case isn’t reached, indicating infinite recursion.
Instance Attribute
self.name (unique to each object).
Class Attribute
species (shared by all Dog objects).
Constructor
init (auto-called during instantiation).
Method vs. Function
Method (defined inside a class, takes self).
Magic Method
Defines how the object is printed (e.g., print(dog)).
Local Variable
total (exists only inside the method).
Class Method
Class method (modifies class-level attributes via cls).
Instantiation
my_dog = Dog() (calls init).
Self Parameter
self refers to the current object instance.