1.define an empty class
use pass to avoid error, python doesn’t let us define classes or functions when they are empty
2. 类中函数的第一个参数总是对象本身,写作self
3. attributes
The power of objects is in their ability to store data,and the data is stored inside objects using attributes. You can think of attributes like special variables that belongs to a particular class. When we instantiate an object, most of the time we specify the data that we want to store inside that object.
4. example
1.make sure you use self.data, otherwise you are not creating an attribute, you’re just assigning to a variable. To access our attribute from within the method, we need to use self.data
2.以下例子出现报错: object() takes no parameters找了很久的错误结果发现初始化函数必须是左右两条下划线**init**