如果用红色哪行,开始瞎循环,如果用绿色就没问题。用for和while效果都一样
n=1
#for n in range(1,25,1):
while(n<25):
print("start %d" % n,end='')
date_obj = pd.to_datetime(df1[2][n])
print ('当前人员第%d' %n,'个%s' % df1[1][n])
#print("%s" % df1[1][n])
#print(" %s" % date_obj.date())
dnow = datetime.now()
nianling = round(((dnow.date()-date_obj.date()).days)/365)
print("年龄%d 岁" % nianling)
print("end %d" % n)
n += 1
@金山办公