oop Flashcards

1
Q

What is DRY?

A

Don’t repeat yourself. It is part of the OOD principles and encourages code reuse.

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

What is the dot ‘.’ when working with classes

A

The access modifier which allows us to access attributes and call methods on an aobject

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

How do you check if a specific object is of a specific type?

A

isinstance(object, type)

print(isinstance(baby, Person)) # Should print True
print(isinstance(baby, object)) # Should print True

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

Is Python an Object Oriented Language

A

Python is object oriented under the hood but it’s not an object oriented first language

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

What is duck-typing also known as

A

Polymorphism

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

What is polymorphism/duck-typing

A

Where the interface to the object determines how it is to be used

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

What is the design principle that encapsulates OOD design principles

A

SOLID

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