14.九九乘法表在excel中显示

workbook=xlwt.Workbook(encoding="utf-8")
worksheet=workbook.add_sheet("sheet1")
for i in range(0,9):
    for j in range(0,i+1):
        worksheet.write(i,j,"%d * %d = %d"%(i+1,j+1,(i+1)*(j+1)))
workbook.save("student.xls")

 

posted @ 2021-03-09 09:57  种太阳  阅读(4)  评论(0编辑  收藏  举报