<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delMargin(self, name):
 """Deletes a margin. Returns True if the margin was deleted and False otherwise. """

        for index, margin in enumerate(self._margins):
            if margin.getName() == name:
                visible = margin.isVisible()
                margin.clear()
                margin.deleteLater()
                del self._margins[index]
                if visible:
                    self.updateViewport()
                return True
        return False