<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def deletePage(self, pno = -1):
 """Delete a page from the document. First page is '0', last page is '-1'. """

        pl = list(range(len(self)))
        if pno < -1 or pno > pl[-1]:
            raise ValueError("page number out of range")
        if pno >= 0:
            pl.remove(pno)
        else:
            pl.remove(pl[-1])
        return self.select(pl)