def main(): duck = MallardDuck() duck.swin() duck.display() duck.performFly() duck.performQuack() duck.setFlyBehavior(FlyNoWay()) duck.setQuackBehavior(Squeak()) duck.performFly() duck.performQuack()
def __init__(self): self.fly_behavior = FlyNoWay() self.quack_behavior = Quack()