-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPLesson02.txt
More file actions
20 lines (12 loc) · 1.18 KB
/
OOPLesson02.txt
File metadata and controls
20 lines (12 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Object-oriented programming (OOP) vocabulary
Class: A blueprint consisting of methods and attributes.
Object: An instance of a class. It can help to think of objects as something in the real world like a yellow pencil, a small dog, or a blue shirt. However, as you'll see later in the lesson, objects can be more abstract.
Python is an OOP languege , datatypes are Class and the values of the those data types become objects instance of the datatypes
Actvity:
benin=[1,'kezia',3,5,6]
print (type(benin))
Output = <class 'list'>
Attribute: A descriptor or characteristic. Examples would be color, length, size, etc. These attributes can take on specific values like blue, 3 inches, large, etc.
Method: An action that a class or object could take.
OOP: A commonly used abbreviation for object-oriented programming.
Encapsulation: One of the fundamental ideas behind object-oriented programming is called encapsulation: you can combine functions and data all into a single entity. In object-oriented programming, this single entity is called a class. Encapsulation allows you to hide implementation details, much like how the scikit-learn package hides the implementation of machine learning algorithms.