Week 1-OOP Flashcards

(16 cards)

1
Q

What is Object Oriented Programming (OOP)?

A

A fundamental concept in Python for building modular, maintainable, and scalable applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the core OOP principles?

A

Classes, objects, inheritance, encapsulation, polymorphism, and abstraction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does a class represent in OOP?

A

A user-defined prototype for an object that defines a set of attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an object in OOP?

A

An instance of a certain class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is encapsulation?

A

The practice of hiding implementation details and allowing access to essential features.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is encapsulation achieved in Python?

A

Through the use of access modifiers (public, protected, private).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is inheritance in OOP?

A

Allows a child class to acquire properties and methods of a parent class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the syntax for defining a child class in Python?

A

class ChildClass(ParentClass):

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is polymorphism?

A

Allows methods to have the same name but behave differently based on context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is compile-time polymorphism?

A

Determined during compilation; allows methods or operators with the same name to behave differently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is run-time polymorphism?

A

Determined during execution; occurs when a subclass provides a specific implementation of a method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is abstraction in OOP?

A

Hides internal implementation details while exposing only necessary functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is partial abstraction?

A

An abstract class that contains both abstract and concrete methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is full abstraction?

A

An abstract class that contains only abstract methods (like interfaces).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Fill in the blank: An object has attributes that are _______ and can perform actions using methods.

A

[specific data]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False: Inheritance promotes code reuse.