Skip to content

Latest commit

 

History

History

0x08-python-more_classes

0x08. Python - More Classes and Objects

Resources:books:

Read or watch:


Learning Objectives:bulb:

What you should learn from this project:

  • Why Python programming is awesome
  • What is OOP
  • “first-class everything”
  • What is a class
  • What is an object and an instance
  • What is the difference between a class and an object or instance
  • What is an attribute
  • What are and how to use public, protected and private attributes
  • What is self
  • What is a method
  • What is the special init method and how to use it
  • What is Data Abstraction, Data Encapsulation, and Information Hiding
  • What is a property
  • What is the difference between an attribute and a property in Python
  • What is the Pythonic way to write getters and setters in Python
  • What are the special str and repr methods and how to use them
  • What is the difference between str and repr
  • What is a class attribute
  • What is the difference between a object attribute and a class attribute
  • What is a class method
  • What is a static method
  • How to dynamically create arbitrary new attributes for existing instances of a class
  • How to bind attributes to object and classes
  • What is and what does contain dict of a class and of an instance of a class
  • How does Python find the attributes of an object or class
  • How to use the getattr function

  • Write an empty class Rectangle that defines a rectangle:
  • Write a class Rectangle that defines a rectangle by: (based on 0-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 1-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 2-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 3-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 4-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 5-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 6-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 7-rectangle.py)
  • Write a class Rectangle that defines a rectangle by: (based on 8-rectangle.py)
  • Write a blog post describing how object and class attributes work.

Author