Unit 11.
4A: Object
Oriented
Programming (OOP)
Programming
CLASSES 11 grade
Unit 11.4A: Object
Oriented
Programming
Learning (OOP)
objectives: • [Link] create classes and
instances of classes
• [Link] develop methods
for the class
Introduction to Classes
Watch the video: Let’s discuss:
[Link]
94Hd4Kz5Y5We
[Link]
why do we use Classes?
what is the difference between Class and
Objects?
what are the property and behavior of an object?
Class: Car Car
Attributes
(a.k.a variables)
Model:
State Color:
Price:
Drive
Park
Objects Behaviors
Start
Stop
Methods(a.k.a
Model: A Model: B functions)
Color: orange Color: blue
Price: 10k Price: 25k
The class is a user-defined data structure that binds the
data members and methods into a single unit. Class is
a blueprint or code template for object creation. Using a
class, you can create as many objects as you want.
Define
An object is an instance of a class. It is a collection of a class
attributes (variables) and methods. We use the object of
a class to perform actions.
Classes have methods and attributes
In Python, creating a method defines a class behavior. The word method is the OOP
name given to a function that is defined within a class. To sum up:
• Class functions is synonym for methods
• Class variables is synonym for name attributes
• Type – indicates the class the instance belongs to
• Attribute – Any object value: [Link]
• Method – a “callable attribute” defined in the class
Declaring a class:
class name:
statements
Practice
WORKSHEET 1: QUIZ (5 MINS) WORKSHEET 2: 5 PROBLEMS
HW:
HTTPS://[Link]/LESSON/6851
67/STEP/1?UNIT=684221
References:
• Python Object-Oriented Programming (OOP) – Pynative
• Python Classes ([Link])
• Head First Python ([Link])
• [Link]
• [Link]
• Изучаем программирование на Python ( PDFDrive ).pdf