<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sub(self, num):
 """ Subtracts num from the current value """

        try:
            val = self.value() - num
        except:
            val = -num
        self.set(max(0, val))