<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def list_books(self):
        ''' Return the list of book names '''
        names = []
        try:
            for n in self.cur.execute("SELECT name FROM book;").fetchall():
                names.extend(n)
        except:
            self.error("ERROR: cannot find database table 'book'")
        return(names)