<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def append(self, clause, weight=None):
 """ Add one more clause to WCNF formula. This method additionally updates the number of variables, i.e. variable ``self.nv``, used in the formula. The clause can be hard or soft depending on the ``weight`` argument. If no weight is set, the clause is considered to be hard. :param clause: a new clause to add. :param weight: integer weight of the clause. :type clause: list(int) :type weight: integer or None .. code-block:: python [[-1, 2]] [[1], [-2]] [10, 20] """


        self.nv = max([abs(l) for l in clause] + [self.nv])

        if weight:
            self.soft.append(clause)
            self.wght.append(weight)
        else:
            self.hard.append(clause)