1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
What is Object-Oriented Programming (OOP)?
A programming style that organizes code into objects containing attributes and methods.
What are attributes in OOP?
Data or information that an object has.
What are methods in OOP?
Actions or behaviors that an object can perform.
What is a class in OOP?
A blueprint or template for creating objects.
What is an object in OOP?
A specific instance created from a class.
What is instantiation in OOP?
The process of creating an object from a class.
What does encapsulation mean in OOP?
Restricting direct access to internal details of a class.
What is inheritance in OOP?
A mechanism that allows one class to reuse code from another class, representing an 'is-a' relationship.
What is polymorphism in OOP?
The ability of different classes to use the same method name but behave differently.
What is abstraction in OOP?
Hiding complicated details and showing only a simple interface.
What is the difference between 'is-a' and 'has-a' relationships?
'Is-a' indicates inheritance, while 'has-a' indicates composition.
What is the LEGB rule in Python?
The order Python searches for variables: Local, Enclosing, Global, Built-in.
What does the global keyword do in Python?
Allows a function to modify a variable from the top level of the program.
What does the nonlocal keyword do in Python?
Allows a nested function to modify a variable from its enclosing function.
What is the purpose of the __init__ method in a class?
It initializes values when an object is created.
What is the difference between instance variables and class variables?
Instance variables are unique to each object, while class variables are shared by all objects of a class.
What is name mangling in Python?
A technique to avoid naming conflicts by changing the name of a variable internally.
What is the @dataclass decorator used for?
Automatically creates common methods for classes that mainly store data.
What is an iterator in Python?
An object that implements the __next__() method and can be iterated over.
What is a generator in Python?
A function that uses yield instead of return, producing one item at a time.
What does isinstance() do in Python?
Checks whether an object is a certain type or a child of that type.
What does issubclass() do in Python?
Checks whether one class is a subclass of another class.
What is multiple inheritance in Python?
A feature that allows a class to inherit from multiple parent classes.
What is Method Resolution Order (MRO)?
The order Python uses to search for methods in the presence of multiple inheritance.