s12-20160227-day07 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160130-day06 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
一.课前回顾 类:具有相同属性和方法的一类事物 实例化:类名() 过程: 开辟了一块内存空间 执行init方法 封装属性 自动的把self返回给实例化对象的地方 对象:实例 一个实实在在存在的实体 组合: 一个类的对象 作为另一个类对象的属性 让两个类之间产生关系 __dict__(): 查看类中所有静态属性和方法 查看所有对象的属性.类对象指针 静态属性:类的属性,所有的对象共享这个变量 对象名:去修改 类的静态属性 在对象的空间中有创建了一个属性,而不能修改类中属性的值 操作静态属性 应该…
一.课前内容回顾 继承作用:提高代码的重用性(要继承父类的子类都实现相同的方法:抽象类.接口) 继承解释:当你开始编写两个类的时候,出现了重复的代码,通过继承来简化代码,把重复的代码放在父类中. 单继承: 重用性:减少代码的重复,子类可以复用父类的方法 派生:子类在父类的基础上又创建了自己的新的方法和属性 子类中有父类的同名方法:只用子类的 还希望用到父类中的方法:父类名(self,...).super(...)调用 抽象类:只能被继承,不能被实例化 模板.规则 抽象类的模板: from abc…
一.课前内容回顾 继承作用:提高代码的重用性(要继承父类的子类都实现相同的方法:抽象类.接口) 继承解释:当你开始编写两个类的时候,出现了重复的代码,通过继承来简化代码,把重复的代码放在父类中. 单继承: 重用性:减少代码的重复,子类可以复用父类的方法 派生:子类在父类的基础上又创建了自己的新的方法和属性 子类中有父类的同名方法:只用子类的 还希望用到父类中的方法:父类名(self,...).super(...)调用 抽象类:只能被继承,不能被实例化 模板.规则 抽象类的模板: from abc…
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin: 15px 0; } /* HEAD…
多态与多态性 一,多态 1,多态指的是一类事物有多种形态(python里面原生多态) 1.1动物有多种形态:人,狗,猪 import abc class Animal(metaclass=abc.ABCMeta): #同一类事物:动物 @abc.abstractmethod def talk(self): pass class People(Animal): #动物的形态之一:人 def talk(self): print('say hello') class Dog(Animal): #动物的…
s12-20160319-day10 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160109-day02 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…
s12-20160116-day03 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin…