American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Python OOP – Gamas

August 6 @ 5:00 pm - 6:00 pm

Today We Did
  1. We reviewed class homeworks (Restaurant and User classes)
  2. We learned about some class terminologies
Homework
  1. Try to memorize below points
    1. THINGS TO REMEMBER
      A. Attributes of a class
          attributes of a class starts with self. For example, Restaurant class has 2 attributes
          1. self.restaurant_name
          2. self.cuisine_type
      B. Class can be used as a custom datatype.
          For example, Dog class is a composition of attributes:
          self.name, self.breed, self.age
      C. Every function / method inside the class it's first parameter has to be "self"
      D. "self" is only used inside a class. Outside a class, "self" is not used or ignored.
      E. "__init__" is called when you create a variable of that class.
         For example, r = Restaurant("Malatang", "Chinese")
         Another example, dog_1 = Dog("Coco", "Dog", "Maltipoo", 9)
      F. a variable whose data type is a class, is often called "object" or "instance"
      G. a function inside a class is commonly called "method".
      H. "__init__" is commonly called "constructor"
  2. Create aug_6_car_class_hw.py
    1. copy codes from page 163 to 164.

Details

Date:
August 6
Time:
5:00 pm - 6:00 pm