-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path43_oops.py
More file actions
15 lines (13 loc) · 982 Bytes
/
43_oops.py
File metadata and controls
15 lines (13 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'''
CLASSES-a blueprint for creating objects that share common attributes (variables) and behaviors (methods). It serves as a template or a structure that defines the properties and functionalities an object of that class will possess.
Classes in Python provide a way to organize and structure code, promote code reusability, and enable the creation of objects with defined behaviors and attributes. They form a fundamental concept of object-oriented programming (OOP) and are widely used in Python development.
syntax:
class Class_name:
methods and variables
OBJECT-an instance of class.when is defined,a template(info)is defined.memory is allocated only after object instantiation.
-object of a given class can invoke the method available to it without revealing the implementation details to user--->abstraction and encapsulation
modelling in OOPS
# name-->class-->employee
# abjective-->attributes-->name,age,salary
# verb-->methods-->getSalary(),increment()
'''