4、上述结果不是想要的格式 那么将工作日、节假日格式转换进行转换为x月x日 月份和日期前面不要0
workday_list [] holiday_list [] for i in date_workday: w_year str(i).split( - )[0] w_month str(i).split( - )[1] w_day str(i).split( - )[2] if w_month[0] 0 : w_month str(i).split( - )[1][1] if w_day[0] 0 : w_day str(i).split( - )[2][1] workday_list.append(w_month 月 w_day 日 ) for j in date_holiday: h_year str(j).split( - )[0] h_month str(j).split( - )[1] h_day str(j).split( - )[2] if h_month[0] 0 : h_month str(j).split( - )[1][1] if h_day[0] 0 : h_day str(j).split( - )[2][1] holiday_list.append(h_month 月 h_day 日 )
5、打印结果
print(workday_list) #打印结果 [ 9月1日 , 9月2日 , 9月3日 , 9月6日 , 9月7日 , 9月8日 , 9月9日 , 9月10日 , 9月13日 , 9月14日 , 9月15日 , 9月16日 , 9月17日 , 9月18日 , 9月22日 , 9月23日 , 9月24日 , 9月26日 , 9月27日 , 9月28日 , 9月29日 , 9月30日 ]



