Python 面向对象学习笔记
                    
                
                    定义类12345678class Student(object):  def __init__(self, name, score):    self.name = name    self.score = score  def print_score(self):    print('%s: %s' % (self.name, self.score))
以上的类的定义中,Student是类名,object是所继承的父类。
使用类对象123Bob = Student('Bob', 56)Bob.nameBob.score
self可省略,python自动加入
继承和多态1234567...