Object-Oriented Programming (OOP): Key Concepts and Python Implementation

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/23

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:02 PM on 4/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

24 Terms

1
New cards

What is Object-Oriented Programming (OOP)?

A programming style that organizes code into objects containing attributes and methods.

2
New cards

What are attributes in OOP?

Data or information that an object has.

3
New cards

What are methods in OOP?

Actions or behaviors that an object can perform.

4
New cards

What is a class in OOP?

A blueprint or template for creating objects.

5
New cards

What is an object in OOP?

A specific instance created from a class.

6
New cards

What is instantiation in OOP?

The process of creating an object from a class.

7
New cards

What does encapsulation mean in OOP?

Restricting direct access to internal details of a class.

8
New cards

What is inheritance in OOP?

A mechanism that allows one class to reuse code from another class, representing an 'is-a' relationship.

9
New cards

What is polymorphism in OOP?

The ability of different classes to use the same method name but behave differently.

10
New cards

What is abstraction in OOP?

Hiding complicated details and showing only a simple interface.

11
New cards

What is the difference between 'is-a' and 'has-a' relationships?

'Is-a' indicates inheritance, while 'has-a' indicates composition.

12
New cards

What is the LEGB rule in Python?

The order Python searches for variables: Local, Enclosing, Global, Built-in.

13
New cards

What does the global keyword do in Python?

Allows a function to modify a variable from the top level of the program.

14
New cards

What does the nonlocal keyword do in Python?

Allows a nested function to modify a variable from its enclosing function.

15
New cards

What is the purpose of the __init__ method in a class?

It initializes values when an object is created.

16
New cards

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.

17
New cards

What is name mangling in Python?

A technique to avoid naming conflicts by changing the name of a variable internally.

18
New cards

What is the @dataclass decorator used for?

Automatically creates common methods for classes that mainly store data.

19
New cards

What is an iterator in Python?

An object that implements the __next__() method and can be iterated over.

20
New cards

What is a generator in Python?

A function that uses yield instead of return, producing one item at a time.

21
New cards

What does isinstance() do in Python?

Checks whether an object is a certain type or a child of that type.

22
New cards

What does issubclass() do in Python?

Checks whether one class is a subclass of another class.

23
New cards

What is multiple inheritance in Python?

A feature that allows a class to inherit from multiple parent classes.

24
New cards

What is Method Resolution Order (MRO)?

The order Python uses to search for methods in the presence of multiple inheritance.