<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_exception(self, code):
 """ Create an exception frame based on this frame. :param code: Modbus exception code to use for this exception :return: ModbusTCPFrame instance that represents an exception """

        frame = deepcopy(self)
        frame.length = 3
        frame.fcode += 0x80
        frame.data = bytearray(chr(code))
        return frame