generate functionThu, 03 Aug 2023

Ejercicio de manejo de Excel en base al fichero 02_Excel_data.xlsx: Abre el fichero Excel Lista las hojas que hay Crea una nueva hoja que se llame olimpiadas entre ventas y otros Vuelve a listar las hojas que hay Guarda los cambios y comprueba en el excel si se han efectuado

!pip install xlrd import xlrd # Open the workbook and select the first worksheet wb = xlrd.open_workbook('02_Excel_data.xlsx') sh = wb.sheet_by_index(0) print('--------------------------') print('Sheet:', sh.name, sh.nrows, sh.ncols) print('--------------------------') print('Sheets:') for name in wb.sheet_names(): print(name) wb.create_sheet("olimpiadas") print('--------------------------') print('Sheets:') for name in wb.sheet_names(): print(name) wb.save('02_Excel_data.xlsx')

Questions about programming?Chat with your personal AI assistant