5.5.1
l1=[1,2,3]
l2=[100,200,300]
l3=l1+l2 #组合
print(l3)
print([1,2,3]*4) #重复
print(2 in [1,2,3]) #指定值在列表中是否在
5.5.2
实例:判断指定姓名再指定日期是否值班,并打对号
import xlrd
from xlutils.copy import copy
wb=xlrd.open_workbook('值班表.xls');ws=wb.sheet_by_name('值班表')
nwb=copy(wb);nws=nwb.get_sheet('值班表')
row_count=ws.nrows-1
n=0
while n<row_count:
n+=1
if '岳成周' in ws.row_values(n)[1:-1]:
nws.write(n,6,'√')
else:
nws.write(n,6,'×')
nwb.save('值班表.xls')