command pattern class addcommand(object)def __init__(selfreceivervalue)self receiver receiver self value value def execute(self)self receiver add(self valuedef undo(self)self receiver subtract(self valueclass subtractcommand(object)def __init__(selfreceivervalue)self receiver receiver self value value def execute(self)self receiver subtract(self valuedef undo(self)self receiver add(self valueclass multiplycommand(object)def __init__(selfreceivervalue)self receiver receiver self value value def execute(self)self receiver multiply(self valuedef undo(self)self receiver divide(self valueclass dividecommand(object)def __init__(selfreceivervalue)self receiver receiver self value value def execute(self)self receiver divide(self value