human
Solve the following python programming problem given the following code:
def open_worksheet(self, file) : 
    if getattr (self, 'filename', '').endswith ('.xls') : 
        import xlwt 
        workbook = xlwt.Workbook () 
        worksheet = workbook.add_sheet ('Sheet 1') 
        def close() : 
            workbook.save (file) 
else : 
        import xlsxwriter 
        workbook = xlsxwriter.Workbook (file) 
        worksheet = workbook.add_worksheet () 
        def close() : 
            workbook.close () 
return (file.write, close) 

    
    

    Fix the buggy line: return (file.write, close)
assistant
#Here is Python program to fix the buggy line: return (file.

return (worksheet.write, close)