human
2.4 继承父类
子类可以扩展父类的定义。将其他类名写在class语句后的圆括号内就可以继承父类："
Please write code following the instructions in jupyter notebook style.
 Write me a code to 2?
assistant
#Here is code to 2.

class Filter:
    def init(self):
        self.blocked=[]
    def filter(self,sequence):
        return [x for x in sequence if x not in self.blocked]
class SPAMFilter(Filter):
    def init(self):
        self.blocked=['SPAM']

f=Filter()
f.init()
f.filter([1,2,3])