Topic 1 - Classes, Objects, and Methods Flashcards

1
Q

class

A

a blueprint or template that defines the data attributes and methods for a particular type of object

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

object

A

an instance of a class, created from the class blueprint with its own set of data attributes and methods

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

methods

A

functions defined within a class that operate on the object’s data attributes

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

__init__() method

A

a special method that is automatically called when an object is created, used to initialize the object’s data attributes

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

self parameter

A

refers to the current object instance and is used to access the object’s data attributes and methods

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

procedural programming

A

focuses on the procedures or actions that take place in a program, with procedures (functions) and data separated

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

object-oriented programming

A

focuses on creating objects that contain both data (attributes) and procedures (methods)

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

encapsulation

A

hides the internal representation of an object from the outside, controlling access to the object’s attributes through methods

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

abstraction

A

hides unnecessary details from users, allowing the implementation of more complex logic without the need to understand the hidden details

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

object reusability

A

objects can be reused in other projects, speeding up development

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

maintainability

A

code is modular, and bugs can be discovered and fixed more easily

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

extensibility

A

new objects can be added with minimum impact to existing objects

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

accessor (getter) methods

A

provide a safe way to retrieve attribute values

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

mutator (setter) methods

A

control how attribute values are modified

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