Python (1) - OOP and Python

in python •  7 years ago  (edited)
  1. Object Oriented Programming (OOP) - A code organization model that tries to encapsulate the real-world into code. It achieves this by using 'objects' or 'classes'.

  2. A 'class' is the mechanism used to create objects; It encapsulates all attributes of the object.

  3. Classes can contain :

  • Data to represent (i.e. coordinates of a Point, face value of a Loan) - also known as 'attributes'
  • An initialization function to initialize any instance-specific data (i.e. coordinates of a Point or face value of a Loan)
  • Methods (functions) that the object can perform
  1. Python provides a powerful OOP toolset but it is not a pure OOP language.
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!