Introduction to Object-Oriented Programming in Python

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

Object-Oriented Programming (OOP)

A method of structuring a program by bundling related properties and behaviors into individual objects.

2
New cards

Class

A 'blueprint' for creating objects.

3
New cards

Instance

An object that belongs to a class.

4
New cards

__init__() Method

Executed when class is initiated; used to assign values to the properties of an object or other operations needed in the creation of an object.

5
New cards

self Parameter

Reference to the current instance of the class; used to access the variables that belong to the class.

6
New cards

Modify Object Properties

Changing the value of an object's property.

<p>Changing the value of an object's property.</p>
7
New cards

Delete Object Properties

Using the del keyword to remove a property from an object.

<p>Using the del keyword to remove a property from an object.</p>
8
New cards

Methods

Functions that belong to the object.

9
New cards

Function

Doesn't need any object and is independent.

10
New cards

Method vs Function

A method is a function linked with an object, while a function can be called directly by its name.

11
New cards

Creating Objects

The process of instantiating a class to create an object.

<p>The process of instantiating a class to create an object.</p>
12
New cards

Deleting Objects

The process of removing an object from memory.

<p>The process of removing an object from memory.</p>
13
New cards

Properties of an Object

Attributes that hold data associated with an object.

14
New cards

Behaviors of an Object

Operations that an object can perform.

15
New cards

Example of an Object

An object could represent a person with properties like a name, age, and address and behaviors such as walking, talking, breathing, and running.

<p>An object could represent a person with properties like a name, age, and address and behaviors such as walking, talking, breathing, and running.</p>
16
New cards

Email Object Example

An object could represent an email with properties like a recipient list, subject, and body and behaviors like adding attachments and sending.

<p>An object could represent an email with properties like a recipient list, subject, and body and behaviors like adding attachments and sending.</p>
17
New cards

Syntax for Deleting Property

del .

18
New cards

First Parameter of Class Function

The self parameter, which can use any other name.

19
New cards

Accessing Class Variables

Using the self parameter to bind the attributes with the given arguments.