>>> bart = Student('Bart Simpson', 59)>>> lisa = Student('Lisa Simpson', 87)>>> bart.age = 8>>> bart.age8>>> lisa.ageTraceback (most recent call last): File "", line 1, in AttributeError: 'Student' object has no attribute 'age'在类里面定义的变量是共有的,创建的每个对象都会继承在类外面定义的变量是私有的,只有自己这个类拥有,别的没有