<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_history(self, num=10, segment=0):
 """ Outputs the last `num` elements that were appended either by `append` or `append_multiple`. Returns ------- out : list """

        if num < 0:
            num = 0
        if segment < 0:
            raise TypeError("segment must be >= 0")
        return self._builder.read_history(num, segment)