object oriented programming
- An object is anything which has two characteristics
- capabilities: What it can do: These become methods
- contents: what it has: These become members
- car
- capabilities:
- start
- stop
- drive
- contents:
- tyres
- engine
- capabilities:
- bankaccount:
- capabilities:
- withdraw
- deposit
- transfer
- contents:
- account number
- balance
- capabilities:
-
movie ticket
- capabilites:
- attend
- contents:
- id
- show time
- theatre
- capabilites:
- An object is a real world entity and to create objects we define Class.
Grocery
- usecases:
- sales
- procurement
- objects:
- product
- user
- inventory
- sale
- bill
Define classes and creating objects in python
- Refer Here
- look at jupyter notebook and classroom recordings
-
objects can be related to each other, on a broader note we have two types of relationships
- is-a (inheritence)
- has-a (composition)
- In python everything is directly or indirectly derived from object
- Refer Here for jupyter notebook
