- This event has passed.
5 PM – Python OOP – Gamas
August 6 @ 5:00 pm - 6:00 pm
Today We Did
- We reviewed class homeworks (Restaurant and User classes)
- We learned about some class terminologies
Homework
- Try to memorize below points
-
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"
-
- Create aug_6_car_class_hw.py
- copy codes from page 163 to 164.